' ? mailing lists">


List Info

Thread: "ocaml_beginners"::[] Having '<<', why to use '|>' ?




"ocaml_beginners"::[] Having '<<', why to use '|>' ?
country flaguser name
France
2007-09-16 17:37:37

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

__._,_.___
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Yoga Groups

Find Enlightenment

&amp; exchange insights

with other members

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )