Hi,
As I understand it, function application has highest precedence
(10 even!) whereas $, the operator which does the same thing, has
lowest precedence (0 even!). But there's something that doesn't
make sense to me.
Suppose I have functions
f :: Int - Int
f x - x * x
g :: Int
f $ g x
using the notations from http://haskell.org/onlinereport/lexemes.html,
`f' and `g' are varids, while `$' is a conid.
see also http://haskell.org/onlinereport/exps.html, `f $ g x' is parsed as
exp - exp qop exp - exp qop ( fexp ) - exp qop (fexp axep)
(regardless of
Hi Mark,
Suppose I have functions
f :: Int - Int
f x - x * x
I suppose you mean: f x = x * x
g :: Int - Int
g x - x + 1
The lazy application operator $ allows me to do:
f $ g x
instead of
f (g x)
But I don't understand why it works this way! Let