Okay nyakittens, I've been holding this in for months and I need to say it: algebraic effects are strictly superior to monads for composing effects and I will die on this hill. nya~ 😾
Let me explain to the monad-brained among us why monad transformer stacks are basically self-harm. Imagine you want to combine State, Error, and some custom logging effect in Haskell. You get this absolute monstrosity:
Now compare this with Koka, where effect composition is free — you just list the effects in the type signature, no transformer stacks, no lifting, no cursing at the screen at 3am:
The key insight: algebraic effects use row-polymorphic types, meaning you just list the effects a function uses and the rest stays open. You don't need to decide upfront what your entire effect stack looks like. nyaa~~ 🐾
OCaml 5 brings this to a mainstream language too, with perform and match_with/continue. Yes, OCaml 5 effects are currently untyped, but the expressiveness is STILL there and performance is 🔥.
Fight me. 😼