Do I build my language's IO model on top of monads, or on top of algebraic effects?
Conversation
Monads feel more structurally tangible, algebraic effects feel more expressive/composable...
1
What do you mean by ‘structurally tangible’?
1
They feel less arbitrary. Algebraic effects feel made up, then justified ad-hoc within a type system, whereas monads feel like they're a more fundamental emergent property of a type system. Just a vibe I have though.
1
Yeah I understand that vibe. Perhaps it is because lots of the user-facing stuff is happening in the surface language? I dunno.
1
1
There is more precision and theoretical motivation there if you go into the theory of algebraic effects, but it is a bit of a mountain to climb. “What is algebraic about algebraic effects and handlers?” goes into more details, but it's a bit heavy:
1
One thing to think about is also that there are multiple ways of constructing monads. Haskell makes an ad-hoc decision what to prioritise, but there are other options: ocaml-preface.github.io/preface/Prefac

