From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 1DF94BBAF for ; Sat, 31 May 2008 19:58:10 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcAAP4uQUjUGypAmWdsb2JhbACBVZBdAQEBAQEIBQYJEQOVFIU7 X-IronPort-AV: E=Sophos;i="4.27,571,1204498800"; d="scan'208";a="13309481" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 May 2008 19:58:09 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4VHw6Gl008532 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 31 May 2008 19:58:09 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqcAAP4uQUjUGypAmWdsb2JhbACBVZBdAQEBAQEIBQYJEQOVFIU7 X-IronPort-AV: E=Sophos;i="4.27,571,1204498800"; d="scan'208";a="13309480" Received: from smtp7-g19.free.fr ([212.27.42.64]) by mail3-smtp-sop.national.inria.fr with ESMTP; 31 May 2008 19:58:08 +0200 Received: from smtp7-g19.free.fr (localhost [127.0.0.1]) by smtp7-g19.free.fr (Postfix) with ESMTP id 62FAF3227F6 for ; Sat, 31 May 2008 19:58:08 +0200 (CEST) Received: from localhost.localdomain (c5850-a2-3-62-147-8-21.dial.proxad.net [62.147.8.21]) by smtp7-g19.free.fr (Postfix) with ESMTP id 8105B3227E8 for ; Sat, 31 May 2008 19:58:07 +0200 (CEST) Date: Sat, 31 May 2008 18:05:20 +0200 From: Fabrice Marchant To: caml-list@inria.fr Subject: Re: [Caml-list] Compose function for multiple parameters ? Message-ID: <20080531180520.11b32a50@free.fr> In-Reply-To: References: <20080531092406.093bd147@free.fr> <20080531101042.25d046ee@free.fr> X-Mailer: Claws Mail 3.2.0 (GTK+ 2.12.9; i486-pc-linux-gnu) X-Face: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 484191AE.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ens-lyon:01 wrote:01 wrote:01 caml-list:01 jambon:01 jambon:01 defining:02 ops:03 parameters:03 parameters:03 let:03 let:03 0200:07 function:08 function:08 On Sat, 31 May 2008 13:24:55 +0200 (CEST) Martin Jambon wrote: > On Sat, 31 May 2008, Fabrice Marchant wrote: > > >> It would be cooler to write the later on the basis of : > >> (( <<- ) (( <<- ) f)) g > > > > Sorry, I just discover that this is cleaner : > > (( <<- ) <<- ( <<- )) > > > > and extendable to any number of parameters. > > > > (( <<- ) <<- ( <<- ) <<- ( <<- )) > > to compose with a 3 parameters function. > > Personally, I call this obfuscated, not clean. > > > Martin OK, it's far to be perfect - funny at best. But what would be the right way ? Defining the 2 ops : let ( <<- ) f g x = f (g x) let ( <<-- ) f g x y = f (g x y) is it better ? Regards, Fabrice