Hitchhiker's Guide to Functional Programming

download Hitchhiker's Guide to Functional Programming

of 15

  • date post

    20-Jan-2017
  • Category

    Technology

  • view

    243
  • download

    2

Embed Size (px)

Transcript of Hitchhiker's Guide to Functional Programming

  • Hitchhiker's Guide to Functional Programming

    https://twitter.com/sshishkinhttps://twitter.com/sshishkinhttps://twitter.com/sshishkinmailto:sergey@shishkin.orgmailto:sergey@shishkin.org

  • Significantly trivialized history of computing

  • Alonzo ChurchResearched decidability of algorithms and invented a

    generic model of calculation the -calculus (early 1930s*)

    *see https://en.wikipedia.org/wiki/Lambda_calculus

    https://en.wikipedia.org/wiki/Lambda_calculus

  • Alan TuringCreated a model of a generic

    computer the Universal Turing machine (ca. 1936*)

    *see https://en.wikipedia.org/wiki/Turing_machine

    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

    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

    http://blog.ploeh.dk/2015/04/13/less-is-more-language-features/

  • John McCarthyCreated Lisp language based on

    the -calculus and featuring macros (ca. 1958*)

    *see http://www-formal.stanford.edu/jmc/history/lisp/lisp.html

    http://www-formal.stanford.edu/jmc/history/lisp/lisp.html

  • Edsger DijkstraMade a case against the

    GOTO statement (in 1968*)*see https://en.wikipedia.org/wiki/Edsger_W._Dijkstra

    https://en.wikipedia.org/wiki/Edsger_W._Dijkstra

  • A case against mutationIts about time to ban the next offender

  • Whats wrong with this code?

    int sum = 0;

    for (int i = 1; i

  • 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)

    https://mitpress.mit.edu/sicp/https://www.coursera.org/course/progfunhttps://www.manning.com/books/functional-programming-in-scalahttp://www.martinfowler.com/articles/refactoring-pipelines.html

  • Questions?

    https://twitter.com/sshishkinhttps://twitter.com/sshishkinhttps://twitter.com/sshishkinmailto:sergey@shishkin.orgmailto:sergey@shishkin.org