Re:Stop Piping Cats
by jrockway on Wednesday February 10, 2010 @10:15PM
(#1116783)
Spoken like a Haskell programmer, who might write:
But note in this case that all the data "flows in the same direction".
[ Parent
| on HN ]
has been a Haskell programmer since 2005, before the dawn of dons
wc Lines $ sort $ grep "bar" $ xargs "foo" =<< fileThat does not parse the way you think it does; the fixity of =<< is greater than $. You would need the shell-style parens if you insist on application instead of composition :)
Prelude> :info $
($) :: (a -> b) -> a -> b -- Defined in GHC.Base
infixr 0 $
Prelude> :info =<<
(=<<) :: (Monad m) => (a -> m b) -> m a -> m b
-- Defined in Control.Monad
infixr 1 =<<
Prelude> :info .
(.) :: (b -> c) -> (a -> b) -> a -> c -- Defined in GHC.Base
infixr 9 .
Incidentally, the parens in my example are actually unnecessary. Function application is about 10, and (.) is 9.