3 ms·
has been a Haskell programmer since 2005, before the dawn of dons wc Lines $ sort $ grep "bar" $ xargs "foo" =<< file
by blasdel 17y ago
has been a Haskell programmer since 2005, before the dawn of dons
wc Lines $ sort $ grep "bar" $ xargs "foo" =<< file
- jrockway 17y agoThat 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.