Hacker News new | ask | show | jobs
by lambdas 346 days 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.
1 comments

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).