3 ms·
Yes — but only if, as in Haskell, that syntactic sugar was generalisable. The whole point of monads is that they are a powerful generalisation that can be used
by klmr 9y ago
Yes — but only if, as in Haskell, that syntactic sugar was generalisable. The whole point of monads is that they are a powerful generalisation that can be used to solve many apparently very different problems. Compared with the syntactic sugar that other languages introduce to solve specific problems (list comprehension/LINQ, `await`, …). You suddenly get a grammar explosion because you keep expressing the same core concept differently.
- scotty79 9y ago> Yes — but only if, as in Haskell, that syntactic sugar was generalisable. Only if you just need one type of monad. If you need interleave multiple monads, haskell syntax is worse because it makes no visible distinction between them.
- tathougies 9y agoThere is no sensible interleaving of multiple monads, and any sensible language would prevent you from any kind of implicit interleaving.
- scotty79 9y agoIn the article there are few monads mentioned: async, nested iteration, maybe, state passing. I can easily imagine sensible mixture of those, and languages with "ad hoc" solutions allow you to mix them.
- tome 9y agoThe distinction is visible in the type.