|
|
|
|
|
by tathougies
2987 days ago
|
|
How are monad transformers a hack? They have a solid theory behind them. i'm not sure where you got the idea that they 'make monads compose'. Monads don't compose. It's nonsensical to talk about monad composition in general, because there is nothing about the structure of a monad that allows it to compose (quite the opposite, really). Some things which may form some monads do compose with certain other things that form monads, but this is like saying 'Abelian groups' are the 'hack' you need to make groups commutative -- it's a meaningless statement. |
|
I am not the OP, and not a Haskell programer, but my understanding is that Monad Transformers exist because Monads don't compose, and when you want monadic effects to compose, you use Monad Transformers (the other option is a go crazy writing every combination and ordering of effects you want by hand).
I got this impression from the papers I have read, particularly this one [1]
Notice the last line of the snippet I posted above. What am I missing?[1]: Monad Transformers Step by Step https://page.mi.fu-berlin.de/scravy/realworldhaskell/materia...