Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: