From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 21CE7BB9C for ; Thu, 1 Dec 2005 02:35:00 +0100 (CET) Received: from ash25e.internode.on.net (ash25e.internode.on.net [203.16.214.182]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id jB11YwHT020567 for ; Thu, 1 Dec 2005 02:34:59 +0100 Received: from rosella (ppp33-4.lns1.syd6.internode.on.net [59.167.33.4]) by ash25e.internode.on.net (8.12.9/8.12.6) with ESMTP id jB11YmIw096313; Thu, 1 Dec 2005 12:04:49 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] composing functions... From: skaller To: Jonathan Roewen Cc: caml-list@yquem.inria.fr In-Reply-To: References: Content-Type: text/plain Date: Thu, 01 Dec 2005 12:34:48 +1100 Message-Id: <1133400888.20197.40.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 438E5342.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 sourceforge:01 functions:01 functions:01 let:03 let:03 thu:05 anyway:05 fold:06 john:08 felix:08 felix:08 i'm:08 wondering:09 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 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 Felix, successor to C++: http://felix.sf.net