Hacker News new | ask | show | jobs
by auggierose 56 days ago
I am still hearing about Monads, but is it not the case that they have well-known flaws? And that is the reason why algebraic effects are interesting, because they don't have these flaws?
2 comments

The biggest problem with monads that I am aware of is that they don't compose: if m1 and m2 are monads, then you can't automatically derive a new monad m3 where m1 (m2 a) and m3 a are equivalent.

Monad transformers are one solution to this. This lets you write the composition rules for m2 once, and then reuse them for every m1. A solution, but boilerplatey.

I don't understand algebraic effects quite as well, but my understanding is that they do simply compose.

Monads are a math/organization pattern. What flaws do you mean?
See the comment by mmaniac.