I encountered this example while reading Learn You a Haskell for Great Good.
ghci> map ($ 3) [(4+), (10*), (^2), sqrt]
[7.0,30.0,9.0,1.7320508075688772]
I don't quite see how to treat $
as function application. Does that mean $
is an operator? But if so, how it will be nested with +
or *
in the example? I tried $ 3 4+
, $ 4 + 3
, but both raised parse error on input ‘$’
. How to think of an expression like this in functional programming context?