caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: skaller <skaller@users.sourceforge.net>
To: Jonathan Roewen <jonathan.roewen@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] composing functions...
Date: Thu, 01 Dec 2005 12:34:48 +1100	[thread overview]
Message-ID: <1133400888.20197.40.camel@rosella> (raw)
In-Reply-To: <ad8cfe7e0511301655w2466f021yee19b32cc07ac95d@mail.gmail.com>

On Thu, 2005-12-01 at 13:55 +1300, Jonathan Roewen wrote:
> Hi,
> 
> I'm getting a bit stuck, and am wondering if there's anyway to compose
> a bunch of functions together easily without having to pre-maturely
> apply any of them.

let compose f g x = f (g x)

let h = compose f g

You can of course fold 'compose' over a list if all the
functions have the same type, if not, then you can't
make the list in the first place :)

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net


  reply	other threads:[~2005-12-01  1:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-01  0:55 Jonathan Roewen
2005-12-01  1:34 ` skaller [this message]
2005-12-01  2:00   ` Jonathan Roewen
2005-12-01  8:46   ` Daniel Bünzli
2005-12-01  1:38 ` Pietro Abate

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1133400888.20197.40.camel@rosella \
    --to=skaller@users.sourceforge.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=jonathan.roewen@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).