top | item 44447713

(no title)

billmcneale | 8 months ago

> That's why the pattern is so useful in the first place

How useful, really? Monads don't even universally compose, which is what most people sell the concept for.

discuss

order

lambdas|8 months ago

Actions compose, types (generally) don’t. So Monad X and Monad Y may not make a valid Monad Z, but Kleisi composition very much exists for actions within a monad.

billmcneale|8 months ago

But the whole promise of monads is precisely that they are a type that can compose.

It basically allows you to pipe successive function calls returning different types by lifting these types into a monad.

Don't get me wrong, that promise is very powerful and in the rare few cases where it works, it unlocks beautiful composition, but the simple truth is that monads are really not that useful outside of Haskell (and I'd say, it's even questionable within).

brooke2k|8 months ago

Monads don't compose between different instances, but monad transformers do.