PCPD Functional Programming PDF
PCPD Functional Programming PDF
F(x)=x%2
X={2,3,4,5,6,7} r=(0,1)
2 0
3 1
Lambda Calculus
The lambda calculus was introduced by mathematician Alonzo Church in the 1930s as part
of an investigation into the foundations of mathematics. Lambda calculus is a formal system in
mathematical logic for expressing computation based on function abstraction and application
using variable binding and substitution.
e.g Expression
F(x)= x%2
Parameter
Parameter
Lambda Abstraction
x.x+1
Expression
Function Signifier
x x%2
F(x,y)=x*y
x. y.x*y x x*y
y
Substitution
F(x)=x*1 f(3)= x*1 3
Need of Lambda
It is Universal mode of computation which can be encode anything.
Syntax
1. Variable E::= x Parameter
2. Function Creation x. E Expression
3. Function Application
E1,E2
Where E1 is calling function with argument E2.
E.g
( x. x+y) 3 3+y
((( x. y. x+y+z)3 ) 4)
( y. 3+y+z)4
3+4+z 7+z