Version française
Home     About     Download     Resources     Contact us    
Browse thread
Having '<<', why to use '|>' ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fabrice Marchant <fabrice.marchant@o...>
Subject: Having '<<', why to use '|>' ?
 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...