4 ms·
> There's nothing you can't do. There are plenty of effects IO (the ambient monad of most languages) doesn't support: You can't do ListT fork effects. You can
by Peaker 13y ago
> There's nothing you can't do.
There are plenty of effects IO (the ambient monad of most languages) doesn't support:
You can't do ListT fork effects.
You can't do ContT effects (coroutines are not as powerful as ContT).
You can't have Parsec effects (you need to write parser combinators as in Haskell).
The Monad generalization is useful for working with nullables, lists, and the effectful view of Monads is only one way to see them.
When using languages "without monads" I do miss Control.Applicative and Control.Monad very much.
- DanWaterworth 13y agoThat's a good point. I was mistaken by saying that, but if Javascript is anything to go by, when people have IO but not continuations, they'll just program in CPS. As I said, once you have continuations, you can create everything else. > the effectful view of Monads is only one way to see them Absolutely, but what's interesting is that it is as general as any other view of monads.
- Peaker 13y agoWhat I was trying to say is that monadic combinators are super-useful in Haskell as they are in Javascript. They're hard to implement in Javascript though, because of return type polymorphism or explicit dictionary passing being required. So people don't implement them -- not because Monads aren't useful there, but because Monads are hard to implement there.