Monads for Functional Programming


Details
Monads for Functional Programming by Philip Wadlerhttp://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/baastad.pdf
Presented by Erik Aker, Software Engineer at Qualcomm
Computer Scientist Philip Wadler is one of the co-creators of the Haskell programming language, a lazy, pure, Functional Programming language. Being a “pure” language, Haskell was initially only capable of evaluating functions without side effects, which unfortunately ruled out all forms of interacting with the operating system (file IO, user input, user output, etc.). If you’ve ever included a “print” statement in a computer program, then you may be able to imagine the scope of this limitation. In fact, programs that can’t talk to the outside world are typically not very interesting, but Haskell overcame this hurdle via Wadler’s usage of the mathematical concept of the monad, which he describes in this paper.
After their appearance in Haskell, Monads became hugely influential in functional programming and have since made appearances in a number of languages (Scheme, Racket, F#, Scala, Ocaml, Purescript, Agda, Idris), as well as in Functional Reactive Programming frameworks such as React, Elm, and Reflex. Various other examples also leap to mind, such as C#'s LINQ (written by Erik Meijer, who served as an editor for Wadler’s “Monads” paper). Indeed, there’s now an aura and mystery around the term monad and a lot of shared humor in the world of Functional Programming about the thousands of attempts to describe this potentially befuddling concept.
In this talk we’ll go over Wadler’s famous paper, and try to evaluate the following questions:
Why did they create a programming language with this problem? In other words, why “purity”? How does the monad work? Why is the solution interesting beyond the world of Haskell? Our talk will attempt to follow this rubric:
A short history of Functional Programming and Haskell A intro to Lambda Calculus and Haskell Close reading of Sections 1 through 3 of the paper Light reading of Section 5 Note: we’re planning to skip over section 4 in the talk, but it is worth reading as another extended motivating example.
Familiarity with Haskell is unnecessary for reading and discussing the paper. However, it can potentially make two aspects of the paper easier to understand: 1) the syntax used and 2) the problems that the paper is addressing. For anyone curious about trying some Haskell in preparation for reading this paper, I recommend the following path:
Download the stack build tool:https://docs.haskellstack.org/en/stable/README/Run “stack ghci” in a terminal to start up a Haskell REPL (this will probably take awhile and require a network connection the first time…)
Run through sections 2 through 6 of Learn You a Haskell for Great Good (type out all the examples in your REPL):
http://learnyouahaskell.com/starting-out
Note: I recommend avoiding the section on monads in Learn You a Haskell until after reading the Wadler paper. In fact, at this point, I’d try to avoid all discussions of monads until after reading the paper.
Street parking on 6th, 7th & 8th Avenues north of B Street is usually easy at that hour. Meters nearby are free after 6. Read signage before you park on A street.
If you're interested in presenting a paper please fill out this form (https://docs.google.com/forms/d/e/1FAIpQLScaI-fWdys27-ByT_HdtsJ73V4AxZr0hf1GSqLsQ1IwAaPdIQ/viewform) or talk to us in person at the meetup.

Monads for Functional Programming