3 ms·
Can someone explain where Roc sits in terms of monads vs effects?
by fire_lake 2y ago
Can someone explain where Roc sits in terms of monads vs effects?
- postepowanieadm 2y agoI don't have a PhD but I would say effects.
- chuckadams 2y agoFirmly on the side of effects: Roc doesn’t have higher-kinded types, which makes it practically impossible to express monads. It’s covered somewhere in https://www.roc-lang.org/faq.html https://www.roc-lang.org/faq.html
- mjaniczek 2y agoHow do you need HKTs for monads?
- chuckadams 2y agoYou need them to express a type constraint that’s generic for all monads. I might have gone a bit too far saying monads would be impossible without HKTs, but a single Monad type class would be, and you lose a lot of the power of monads if you don’t have that.
- fire_lake 2y agoYou can do monads without HKT but it is much more manual. You need to compose monad transformers yourself, for example.
- fourteenminutes 2y agoSide effects are monadic (the main side-effectful abstraction, Task, is the continuation monad). There are no algebraic effects.