Tumblr is where tens of millions of creative people around the world share and follow the things they love.Sign up to find more cool stuff to follow
"The Essence of Functional Programming" Part 1: The Identity Monad
This is the first of a new series of posts that will take papers that I read and will explain them and attempt to make them more concrete (and less theoretical) by showing real world examples using more industry-standard languages. These papers will be tagged with theory-in-practice. For more information on the “Theory in Practice” series, read the introductory post.
Today’s paper is “The essence of functional programming” by Philip Wadler. This paper is widely known as the paper which popularized monads, and introduces them in a relatively elementary context with a focus on practical programming use.
This is part 1 of a multi-part series. In order to allow the information to soak in and to not consume too much of your time, I’ve decided to split this into multiple parts which I will publish over the coming weeks. These will all be tagged with essence-of-functional-programming.
Part 1 will cover the inspiration for monads as well as introduce the trivial monad.
Prior knowledge required: Basic programming experience with basic experience in functional programming (in any language, whether it be Ruby, Python, C, etc.). The examples will be given in Haskell and Scala.
I re-watched the ending of Ergo Proxy and.. I cried. It was when Monad was asking Ergo why he wanted to keep fighting, in the midst of all of that pain and anguish, why couldn’t he forget? In which he replied something that brought me to tears.
“I can’t let myself forget anymore. I’m not talking about a mission of fate. I’m talking about living with and facing one another, colliding with each other, supporting each other, holding each other…”
(Monad): “What’s there to like about that sort of reality? A place where its dark and cold, and there’s no knowing what lies ahead…”
“Because that’s our reality. It may be all those things you said… but there’s someone waiting for me there.”