2 ms·
Haskell has `&` in Data.Function. You can try it in ghci: Prelude> f a x = a * x Prelude> g x = x + 2 Prelude> g $ f 3 $ 5 17 Prelude> :m +Data.Funct
by nequo 4y ago
Haskell has `&` in Data.Function. You can try it in ghci:
Prelude> f a x = a * x
Prelude> g x = x + 2
Prelude> g $ f 3 $ 5
17
Prelude> :m +Data.Function
Prelude Data.Function> 5 & f 3 & g
17
It is like `$` but with the arguments flipped:
($) :: (a -> b) -> a -> b
(&) :: a -> (a -> b) -> b