The main ideas are applying a function to an argument and forming functions by abstraction.
Name | Syntax | Example | Explanation |
---|---|---|---|
Variable | <name> | x | a variable named “x” |
Function | λ<parameters>.<body> | λx.x | a function with parameter “x” and body “x” |
Application | <function><variable or function> | (λx.x)a | calling the function “λx.x” with argument “a” |
Arithmetic
- 0 =
λs.(λz.z)
- 1 ≡
λsz.s(z)
- 2 ≡
λsz.s(s(z))
- 3 ≡
λsz.s(s(s(z)))