Is a burrito a monad?
Tom Sherman
Posted on July 25, 2020
This post was originally posted on my blog.
As we all know, a monad is just a monoid in the category of endofunctors. This is intuitive to you and I, but what if you need to explain what a monad is in more practical terms. Well that's where the three laws of monads come in.
These three laws act as a test to tell if something is a monad - if that something passes the three laws, then it's a monad - simples.
Now to the main event, is a burrito monad? Well let's see if it obeys the three laws...
Left identity
Take your filling, put it in a burrito - toast it - take the filling back out - the filling is warm just as if you toasted the filling itself.
So the burrito passes the first law.
Right identity
Unwrap the burrito to get to the filling.
The burrito passes the second law.
Associativity
Putting hot sauce in your burrito and then toasting it is the same as toasting it and putting hot sauce in your burrito.
Thus the burrito passes the third law.
The burrito is a monad ๐ฏ
Further reading
Burritos for the Hungry Mathematician by Ed Morehouse
Posted on July 25, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
October 28, 2024