Thread: "ocaml_beginners"::[] Having '<<', why to use '|>' ?
"ocaml_beginners"::[] Having
'<<', why to use '|>' ?
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 ?