4 ms·
What do monad comprehensions offer?
by exdsq 5y ago
What do monad comprehensions offer?
- thewakalix 5y agoList comprehensions are a concise way of writing do-expressions in the list monad, so monad comprehensions just extend that to all monads.
- jolmg 5y agoBeing very generic. One can define a very efficient array structure, define its Monad instance and be able to use it in comprehensions. The point is that comprehensions are not fixed to a particular data structure by the language, and can be used with any user-definable Monad.