Lambda Calculus operators precedence
I have problems understanding lambda calculus operators precedence.
For example the following code:
lambda x.x z lambda y.x y
is going to be:
lambda x. (x (z lambda y. x y))
or
lambda x. ((x z) (lambda y. x y))
?
Even more complicated examples:
(lambda x.x z) lambda y.w lambda w.w x y z
where in the above example the parentheses go ?
I know that lambda application is le开发者_如何学运维ft associative but does lambda values have higher precedence over applications?
Application has higher precedence than abstraction. Together with the fact that application is left-associative and abstraction is right-associative, this leads to the following:
lambda x.x z lambda y.x y
is
lambda x. ( (x z) (lambda y. (x y)) )
and
(lambda x.x z) lambda y.w lambda w.w x y z
is
(lambda x. (x z)) (lambda y. (w (lambda w. (((w x) y) z))))
精彩评论