caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Compose function for multiple parameters ?
@ 2008-05-31  7:24 Fabrice Marchant
  2008-05-31  8:10 ` [Caml-list] " Fabrice Marchant
  0 siblings, 1 reply; 9+ messages in thread
From: Fabrice Marchant @ 2008-05-31  7:24 UTC (permalink / raw)
  To: caml-list

  Hi !

Defining a compose operator :

let ( <<- ) f g x = f (g x)

allows to abstract from parameter and to handle functions nicely :

f <<- g

  My question is : 
  What would be the correct way with more parameters ?

I do not see anything satisfactory neither multiplying the operators :
let ( <<<- ) f g x y = f (g x y);;
  (That would quickly lead to an unreadable code.)

nor keeping with a one-parameter 'compose' to synthesize what we need :

(( <<- ) f) <<- g

Imho, the former is even the worst.

It would be cooler to write the later on the basis of :
(( <<- ) (( <<- ) f)) g

with some operator that could be used as an unary op to lighten the writing.

  Please what would be possible to do ?

Fabrice


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-06-01  8:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-31  7:24 Compose function for multiple parameters ? Fabrice Marchant
2008-05-31  8:10 ` [Caml-list] " Fabrice Marchant
2008-05-31 11:24   ` Martin Jambon
2008-05-31 16:05     ` Fabrice Marchant
2008-06-01  8:39       ` Florent Monnier
     [not found]     ` <20080531180149.04e6ac5e@free.fr>
2008-05-31 21:37       ` Martin Jambon
2008-06-01  0:04         ` Robert Fischer
2008-06-01  5:24           ` Fabrice Marchant
2008-06-01  6:16         ` Fabrice Marchant

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).