14 ms·
True, I got that piece of the syntax wrong. I guess you can do something very close, though.
by eru 4y ago
True, I got that piece of the syntax wrong.
I guess you can do something very close, though.
- dllthomas 4y agoAbsolutely. Almost every group of symbols can be used as an operator, just (as it happens) not a single | because that is reserved for patterns.
- nequo 4y agoHaskell 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