What is a monad? (Design Pattern)

preview_player
Показать описание
Programming often relies on combining functions in data pipelines. The monad is a design pattern which makes pipelines with effect much easier to write and maintain.

Monads are often explained using haskell in complicated ways but I tried here to simply explain the pattern with javascript to build an intuition of them.
Рекомендации по теме
Комментарии
Автор

Hiya! It turns out that what is described in this video is the Functor and not the Monad. The difference between these two is quite minor so I'll leave it here.
A monad is just a functor which has some extra property within the bind method. Functions being passed in bind calls must have as their return types an instance of the monad being used. The bind method of a monad would then need to "unwrap" that value.

AByteofCode
Автор

A monad is just a monoid in the category of endofunctors. I don't know what people don't get about that.

andrasfogarasi
Автор

I'm a big fan of the "fireship style" of videos and it's great to see more people creating high quality content like this

crabbyboi
Автор

I already know what a monad is: it's that thing that my annoying friend who's just learned Haskell won't stop talking about

falkelh
Автор

This 2 minute video is a better explanation of monads than some hour long lecture I've watched. Really good stuff!

tylerscott
Автор

You may be very small now, but with this quality of content you will definitely be big one day!

samuelwaller
Автор

Fireship's influence shows. You're also just as talented at explaining complex things in a short time.

tsyf
Автор

What can I do to make my future videos better? Any feedback (even negative) is much appreciated!

AByteofCode
Автор

This has to be the best explanation of Monads I have found out of all the many, many, many videos I have watched, and definitely the most productive 2 minutes and 30 second - highly recommended.
I suspect one of the major difficulties with explaining the concept are the different mindsets of the audience from the instructor. The vast majority of instructors will be from a declarative/Functional Programming background where solutions are defined in terms of what needs to be done. The audience will largely comprise developers from an imperative OOP/Procedural background where solutions are formed by defining the steps required to resolve the problem.
Having an explanation in terms of how the monad resolves a problem by absorbing some of the steps is really easy to understand. The last 60 seconds of this video really hits that message home, but I would not go as far as to suggest watching the video in reverse.

gilmoretj
Автор

I commend you for having so clearly and accessibly explained a notoriously difficult topic. I finally feel like I actually understand what these are now. Thanks!

swankitydankity
Автор

That’s probably the best concise explanation of monad I’ve read so far!

robinmoussu
Автор

There have been many attempts to explain monads and many have failed but your example makes it extremely clear, thank you

DanielRamBeats
Автор

Great video±! You have enlightened my vision on computer science by finally explaining to me what a monad is dude.

benjaminshu
Автор

The best Monad explanation I've seen so far.

sanketower
Автор

These videos are well made, keep making them!

polycode
Автор

I still don't understand monads 100%,
But this video is where I can say I got the closest to understand them.
And the most surprising thing is the video length! I have watched, before this, a lot of other videos about monads, and some of them were really long and thorough, but I consider this one is the best so far.

I can't be sure whether it's the example you gave or the fact that I'm watching this after watching many similar videos, but this is defiantly QUALITY CONTENT, short, concise, holistic and well-narrate.
Thankyou very much

sharbelokzan
Автор

To the point, concise and clear explanation. Just what a developer needs.

thorodinson
Автор

Most clear and concise explanation of monads that I've seen - amazing stuff

uselessDev
Автор

Wow, that was a very clear explanation !
Now I know how useful monads are.
Unfortunately, I already forgot what they are.

leshommesdupilly
Автор

This is the most comprehensible explanation of monads I've come across. Thanks.

charleshughes