gotchaModerate
Is there a difference between $\lambda xy.xy$ and $\lambda x.\lambda y.xy$?
Viewed 0 times
differencebetweenandtherelambda
Problem
I am currently learning the lambda calculus and was wondering about the following two different kinds of writing a lambda term.
Is there any difference in meaning or the way you apply beta reduction, or are those just two ways to express the same thing?
Especially this definition of pair creation made me wonder:
pair = $\lambda xy.\lambda p.pxy$
- $\lambda xy.xy$
- $\lambda x.\lambda y.xy$
Is there any difference in meaning or the way you apply beta reduction, or are those just two ways to express the same thing?
Especially this definition of pair creation made me wonder:
pair = $\lambda xy.\lambda p.pxy$
Solution
The first is an abbreviation for the second. It's a common syntactic convention to shorten expressions.
On the other hand, if you have tuples in the language, then there is a difference between
In the former case I can provide a single argument to the function, and pass the resulting function around to other functions. In the latter case, both arguments must be supplied at once. There is, of course, a function that can be applied to convert 1 into 2 and vice versa. This process is known as (un)currying.
The definition of $\text{pair}$ you mention is an encoding of the notion of pairs into the $\lambda$-calculus, rather than pairs as a primitive data type (as I hinted at above).
On the other hand, if you have tuples in the language, then there is a difference between
- $\lambda x.\lambda y.xy$ and
- $\lambda (x,y).xy$.
In the former case I can provide a single argument to the function, and pass the resulting function around to other functions. In the latter case, both arguments must be supplied at once. There is, of course, a function that can be applied to convert 1 into 2 and vice versa. This process is known as (un)currying.
The definition of $\text{pair}$ you mention is an encoding of the notion of pairs into the $\lambda$-calculus, rather than pairs as a primitive data type (as I hinted at above).
Context
StackExchange Computer Science Q#653, answer score: 17
Revisions (0)
No revisions yet.