6 ms·
> P. S. When studying Haskell on a CS course in school, I used to define exactly the same squiggly arrow operator for my programs :-) Haskell base already has
by oispakaljaa 3y ago
> P. S. When studying Haskell on a CS course in school, I used to define exactly the same squiggly arrow operator for my programs :-)
Haskell base already has the reverse application operator (&) which does the same thing. Not included in the prelude but can be imported from Data.Function. [1] It's defined as:
(&) :: a -> (a -> b) -> b
x & f = f x
Not that there's anything wrong with using your own definitions, just thought I'd point it out!
[1] https://hackage.haskell.org/package/base-4.18.1.0/docs/Data-Function.html#v:-38- https://hackage.haskell.org/package/base-4.18.1.0/docs/Data-...