The True Use Of Monads In FP

Part 1: Essence of Functional Programming

Usher Klein
Descript Software
2 min readMay 15, 2018

--

Why are monads useful in FP?

Most aspiring functional programmers have seen their fair share of monad “tutorials”. Yet, despite the overwhelming amount of content on the topic, understanding the relatively simply defined monad still seems to elude most. I’m convinced the reason for this is that most “tutorials” give the definition, along with analogies to help people understand the definition, but fail to present the motivating problem. What does it matter if a monad is a burrito or not, if I don’t know why I would want a burrito in the first place?

What is functional programming?

Functional programming is writing programs by composing functions. Trust me, that’s all it is. All the other shenanigans are prerequisites, supports, or outcomes of function composition.

Combining functions with function composition is a lot of fun, but eventually functional programmers found functions they wanted to combine, but that couldn’t be combined with normal function composition. The usefulness of monads, like most advanced FP concepts, is in coming up with ways to “compose” new classes of functions.

Up Next: The motivating problem in JavaScript

Asher Klein is the Founder & CEO of Descript Software. He holds a degree in Pure & Applied Mathematics from Concordia University.

--

--