whatthefuck.is icon indicating copy to clipboard operation
whatthefuck.is copied to clipboard

WTF is a Monad?

Open lyovson opened this issue 4 years ago • 11 comments

Someone had to do it, so here I am]]

lyovson avatar Jul 11 '20 04:07 lyovson

A monad is just a monoid in the category of endofunctors, what's the problem?

tom-sherman avatar Jul 11 '20 10:07 tom-sherman

A monad is a burrito :burrito:

(wrong answers only right?)

gillchristian avatar Jul 11 '20 10:07 gillchristian

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 🌯

tom-sherman avatar Jul 11 '20 13:07 tom-sherman

Ok, got it, a monad is a burrito a box of endofunctors. Right?

lyovson avatar Jul 11 '20 21:07 lyovson

This is interesting Maybe topic!

naingaungphyo avatar Jul 13 '20 18:07 naingaungphyo

+1

silvanocostanzo avatar Jul 14 '20 12:07 silvanocostanzo

Something being a Monad just means it flatmaps.

evertbouw avatar Jul 14 '20 13:07 evertbouw

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.

sdball avatar Jul 14 '20 23:07 sdball

Need make a WTF is an Endofunctor? first. Maybe a WTF is a Functor? before. And a WTF is Category theory first at all.

jseling avatar Jul 15 '20 12:07 jseling

I had to link this here: https://youtu.be/BoJGIqyriCc

eltonvs avatar Jul 20 '20 02:07 eltonvs

Yeah, wtf is a monad? https://twitter.com/dan_abramov/status/1285925737258717190

joms avatar Jul 23 '20 11:07 joms