caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Having '<<', why to use '|>' ?
@ 2007-09-17 14:36 Fabrice Marchant
  2007-09-17 18:59 ` [Caml-list] " Eric Cooper
  2007-09-17 22:24 ` Julien Moutinho
  0 siblings, 2 replies; 16+ messages in thread
From: Fabrice Marchant @ 2007-09-17 14:36 UTC (permalink / raw)
  To: caml-list

 Hello !

For f1 and f2 composable functions, writing :   

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

let g1 = f2 << f1

let ( |> ) x f = f x

let g2 = fun x ->
               x
            |> f1
            |> f2  

I usually use '<<' and wonder if we can always supersede '|>' by this operator ?
g1 and g2 are same functions ( not true ? ).
Does it exists a case where the use of '|>' is better ?

Thanks,

 Fabrice
-----------------------------------
Force est de constater que mon post sur Lucky et Camel n'a pas fait un tabac...


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

end of thread, other threads:[~2007-09-21 21:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-17 14:36 Having '<<', why to use '|>' ? Fabrice Marchant
2007-09-17 18:59 ` [Caml-list] " Eric Cooper
2007-09-17 19:45   ` Fabrice Marchant
2007-09-17 22:24 ` Julien Moutinho
2007-09-18  5:39   ` Fabrice Marchant
2007-09-18  8:53     ` Julien Moutinho
2007-09-18  9:09       ` Julien Moutinho
2007-09-18 14:12       ` Fabrice Marchant
2007-09-18 16:42         ` Jon Harrop
2007-09-18 20:41           ` skaller
2007-09-19 19:49           ` Fabrice Marchant
2007-09-19 21:56             ` Vincent Aravantinos
2007-09-20 13:42             ` Ashish Agarwal
2007-09-20 18:37               ` Gabriel Kerneis
2007-09-21 20:58               ` Harrison, John R
2007-09-21 21:44                 ` Karl Zilles

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