## Many tutorials explain Monads but left me questioning, under what scenario did someone jump up and proclaim “We need to invent monads to solve this problem!”? I’m less interested in Haskell specifically and more interested in the concepts so here’s an attempt at motivating monads with basic secondary school Algebra.

Forget you know how to program for a moment.

When you were a kid, you probably learned about functions in Algebra 1. You probably learned to write out tables for functions like this:

f(x) = x^2 + x + 1

As follows:

f(0) = 1

f(1) = 3

f(2) =…