A little bit of Lamba Calculus.
What is that and how it is applied in functional programming languages.
Currying, High Order Functions, Anonymous Functions
2. Origin
First observed in the late 1890s
Formalized in the 1930s
Developed in order to study mathematical properties.
Lambda calculus is a conceptually simple universal
model of computation
2
3. Motivation
The lambda calculus can be called the smallest
universal programming language of the world
3
4. What is this?
The name derives from the Greek letter lambda (λ) used to
denote binding a variable in a function
Single transformation rule -> variable substitution
Single function definition schema
Any computable function can be expressed and evaluated
using this formalism
Functional Programming essentially implements this
calculus
The λ-calculus provides a simple semantics for
computation, enabling properties of computation to be
studied formally
4
5. Lambda Terms
a variable is itself a valid lambda term
if t is a lambda term, and x is a variable, then ( λx.t) is
a lambda term (called a lambda abstraction);
if t and s are lambda terms, then (ts) is a lambda term
(called an application).
Thus a lambda term is valid if and only if it can be
obtained by repeated application of these three rules
5
6. lambda abstraction
λ x.t
X is the input
T is the expression
λ x.x+2 == f(x) = x +2
6
8. Lambda Property – 1 -Equivalent
In computer programming,
an anonymous
function (also function
constant, function
literal, or lambda
function) is a function (or
a subroutine) defined, and
possibly called, without
being bound to
an identifier.
8
9. Lambda Property-2
In lambda calculus,
functions are taken to be
'first class values', so
functions may be used as
the inputs, or be
returned as outputs from
other functions.
9
10. Lambda Property-2 - Equivalent
In mathematics and comp
uter science, a higher-
order
function (also functional
form, functional or funct
or) is a function that does
at least one of the
following:
take one or more functions
as an input
output a function
10
12. Lambda Property 3 - Equivalent
In mathematics and com
puter
science, currying is the
technique of
transforming
a function that takes
multiple arguments (or
a tuple of arguments) in
such a way that it can be
called as a chain of
functions, each with a
single argument
12
13. Much more
α-conversion: changing bound variables (alpha);
β-reduction: applying functions to their arguments
(beta);
η-conversion: which captures a notion of
extensionality (eta).
Recursion
Parallelism and concurrency
13