
8 Jun
2015
8 Jun
'15
6:01 a.m.
Mike Meyer:
s mp $ n - 1 parses as s mp (n - 1) s mp n - 1 parses as (s mp n) - 1
Hi, I think it is misleading to say that $ "parses" to something. ($) is an infix operator with type: ($) :: (a -> b) -> a -> b -- Defined in ‘GHC.Base’ infixr 0 $ So what it does is it takes a function on the left hand side and applies it to the second argument on the right hand side. The trick is it has the lowest possible precedence value (0) so everything on the right hand side will be evaluated before applying the function on the left. This is useful as a convenience if you want to avoid writing too many parentheses. Martin