Hitchhiker's Guide to
Functional Programming
Significantly trivialized
history of computing
Alonzo Church
Researched decidability of
algorithms and invented a
generic model of calculation –
the λ-calculus (early 1930s*)
*see https://en.wikipedia.org/wiki/Lambda_calculus
Alan Turing
Created a model of a generic
computer – the Universal Turing
machine (ca. 1936*)
*see https://en.wikipedia.org/wiki/Turing_machine
John von
Neumann
Created the architecture of
modern computers based
on the Universal Turing
machine (early 1940s*)
*see https://en.wikipedia.org/wiki/Von_Neumann_architecture
And PL features exploded...
GOTO, mutation, pointers, null refs, exceptions,
floating point numbers, inheritance, interfaces,
threads…
See http://blog.ploeh.dk/2015/04/13/less-is-more-language-features/ for a discussion of harmful PL features
John McCarthy
Created Lisp language based on
the λ-calculus and featuring
macros (ca. 1958*)
*see http://www-formal.stanford.edu/jmc/history/lisp/lisp.html
Edsger Dijkstra
Made a case against the
GOTO statement (in 1968*)
*see https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
A case against mutation
It’s about time to ban the next offender
What’s wrong with this code?
int sum = 0;
for (int i = 1; i <= 10; i++)
{
if (i % 2 == 0)
sum += i * i;
}
System.out.println(sum);
Refactoring exercise
Erik Meijer
Recursion is GOTO of
functional programming
● λ-Calculus is a model of computation
● Program is data, generic evaluation algorithm
● Turing machine is a model of a computer
● Program is algorithm
Turing machine and λ-calculus are proven equivalent in terms of computability
Summary
Learn More (click on the images)
Questions?

Hitchhiker's Guide to Functional Programming

  • 1.
  • 2.
  • 3.
    Alonzo Church Researched decidabilityof algorithms and invented a generic model of calculation – the λ-calculus (early 1930s*) *see https://en.wikipedia.org/wiki/Lambda_calculus
  • 4.
    Alan Turing Created amodel of a generic computer – the Universal Turing machine (ca. 1936*) *see https://en.wikipedia.org/wiki/Turing_machine
  • 5.
    John von Neumann Created thearchitecture of modern computers based on the Universal Turing machine (early 1940s*) *see https://en.wikipedia.org/wiki/Von_Neumann_architecture
  • 6.
    And PL featuresexploded... GOTO, mutation, pointers, null refs, exceptions, floating point numbers, inheritance, interfaces, threads… See http://blog.ploeh.dk/2015/04/13/less-is-more-language-features/ for a discussion of harmful PL features
  • 7.
    John McCarthy Created Lisplanguage based on the λ-calculus and featuring macros (ca. 1958*) *see http://www-formal.stanford.edu/jmc/history/lisp/lisp.html
  • 8.
    Edsger Dijkstra Made acase against the GOTO statement (in 1968*) *see https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
  • 9.
    A case againstmutation It’s about time to ban the next offender
  • 10.
    What’s wrong withthis code? int sum = 0; for (int i = 1; i <= 10; i++) { if (i % 2 == 0) sum += i * i; } System.out.println(sum);
  • 11.
  • 12.
    Erik Meijer Recursion isGOTO of functional programming
  • 13.
    ● λ-Calculus isa model of computation ● Program is data, generic evaluation algorithm ● Turing machine is a model of a computer ● Program is algorithm Turing machine and λ-calculus are proven equivalent in terms of computability Summary
  • 14.
    Learn More (clickon the images)
  • 15.