The Haskell Unfolder Episode 34: you already understand monads

preview_player
Показать описание
Function composition is the idea that we can take two functions and create a new function, which applies the two functions one after the other. When viewed from the right angle, monads generalize this idea from functions to programs: construct new programs by running other programs one after the other. In this episode we make this simple idea precise. We will also see what the monad laws look like in this setting, and we will discuss an example of what goes wrong when the monad laws are broken.

Links:

Рекомендации по теме
Комментарии
Автор

Great way to introduce the Monad. I never thought about it this way. Saying it is composition of two programs also makes a lot of sense and avoids the common Monad container analogy.

christianschafer
Автор

Great video! I like the choice if using composition rather than bind and will try it whenever I teach monads again. Also: kudos for showing the importance of laws as a way of enabling refactorings. I'd just like to add that laws are also useful for reasoning about functions that operate over general monads e.g. sequence or foldM.

pedrovasconcelos
Автор

Thank you for the great video! It was very helpful.

MP-bw
Автор

This is a great way of conceptualizing monads which are intuitively understood as programs producing values, but IMO doesn't attempt to develop such an understanding for other monadic types that are not obviously programs: Reader, [], Maybe, Either, etc.

sccrstud
Автор

Great content as always. Your channel deserves to be bigger. Please heed my advice: remove access to the older livestreams and then you upload the recordings instead, as regular videos. Upload one episode every 4th day on the spot. You will be Amazed of the views and subscriber count after a couple of weeks. You can use the timer feature so it's not much work. I got from 0 subs to 20k in ten months. JB

dr-Jonas-Birch
Автор

Thanks for the example.
Do you have more examples about the monads like Timed ?

SuperZsomi
Автор

It was thanks to a video explaining monads through the operator <=< that I understood them (maybe from Bartosz Milewski??)

georgH
Автор

Great ep! Is it possible to provide a more sensible instance for Monad in the Timed example?

lucastourinho