On the Expressive Power of User-Defined Effects: Effect Handlers, Monadic Reflection, Delimited Control
Yannick Forster, Ohad Kammar, Sam Lindley, Matija Pretnar

TL;DR
This paper compares the expressive power of three user-defined effect abstractions—effect handlers, monadic reflection, and delimited control—highlighting their relative strengths, limitations, and the impact of language features on their expressiveness.
Contribution
It provides a formal comparison of three computational effect abstractions, establishing their relative expressiveness and limitations through calculi, semantics, and formal translations.
Findings
Effect handlers cannot be macro-expressed by monadic reflection or delimited control while preserving typeability.
All three abstractions can macro-express each other, but with restrictions.
The expressiveness of user-defined effects is sensitive to language features.
Abstract
We compare the expressive power of three programming abstractions for user-defined computational effects: Bauer and Pretnar's effect handlers, Filinski's monadic reflection, and delimited control without answer-type-modification. This comparison allows a precise discussion about the relative expressiveness of each programming abstraction. It also demonstrates the sensitivity of the relative expressiveness of user-defined effects to seemingly orthogonal language features. We present three calculi, one per abstraction, extending Levy's call-by-push-value. For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics. We establish their basic meta-theoretic properties: safety, termination, and, where applicable, soundness and adequacy. Using Felleisen's notion of a macro…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
