Re:Stop Piping Cats
by blasdel on Thursday February 11, 2010 @02:58AM
(#1117179)
has been a Haskell programmer since 2005, before the dawn of dons
[ Parent
| on HN ]
That 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.