Version française
Home     About     Download     Resources     Contact us    
Browse thread
Compose function for multiple parameters ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice Marchant <fabricemarchant@f...>
Subject: Re: [Caml-list] Compose function for multiple parameters ?
On Sat, 31 May 2008 13:24:55 +0200 (CEST)
Martin Jambon <martin.jambon@ens-lyon.org> 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