whatthefuck.is
whatthefuck.is copied to clipboard
WTF is a Monad?
Someone had to do it, so here I am]]
A monad is just a monoid in the category of endofunctors, what's the problem?
A monad is a burrito :burrito:
(wrong answers only right?)
I think you could be onto something...
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. The burrito passes the third law.
The burrito is a monad 🌯
Ok, got it, a monad is a burrito a box of endofunctors. Right?
This is interesting Maybe topic!
+1
Something being a Monad just means it flatmaps.
Putting in hot sauce and then toasting is not the same as toasting and then putting in hot sauce. Toasting hot sauce changes the properties of the hot sauce.
Need make a WTF is an Endofunctor? first. Maybe a WTF is a Functor? before. And a WTF is Category theory first at all.
I had to link this here: https://youtu.be/BoJGIqyriCc
Yeah, wtf is a monad? https://twitter.com/dan_abramov/status/1285925737258717190