Reference. Handlers in action
Cite
Cited by (10)
Yarrow: Reconciling Effect Handlers and Region-Based Memory Management mathiasen-2026-yarrow
Modular models of monoids with operations by lifting functors along fibrations yang-2026-modular
An Equational Axiomatization of Dynamic Threads via Algebraic Effects: Presheaves on Finite Relations, Labelled Posets, and Parameterized Algebraic Theories kammar-2026-an
Structured Handling of Scoped Effects yang-2022-structured
Reasoning about effect interaction by fusion yang-2021-reasoning
Doo bee doo bee doo convent-2020-doo
Effect handlers via generalised continuations hillerstrom-2020-effect
On the expressive power of user-defined effects: Effect handlers, monadic reflection, delimited control forster-2019-on
Do be do be do lindley-2017-do
Continuation Passing Style for Effect Handlers hillerstrom-2017-continuation
We present Continuation Passing Style (CPS) translations for Plotkin and Pretnar’s effect handlers with Hillerström and Lindley’s row-typed fine-grain call-by-value calculus of effect handlers as the source language. CPS translations of handlers are interesting theoretically, to explain the semantics of handlers, and also offer a practical implementation technique that does not require special support in the target language’s runtime.
We begin with a first-order CPS translation into untyped lambda calculus which manages a stack of continuations and handlers as a curried sequence of arguments. We then refine the initial CPS translation first by uncurrying it to yield a properly tail-recursive translation and second by making it higher-order in order to contract administrative redexes at translation time. We prove that the higher-order CPS translation simulates effect handler reduction. We have implemented the higher-order CPS translation as a JavaScript backend for the Links programming language.
Cites 46 works (1 here)
With notes (1)
Algebraic foundations for effect-dependent optimisations kammar-2012-algebraic
External (45)
- Programming and reasoning with algebraic effects and dependent types (2013)
- The pipes package (3.2.0) (2013)
- Relating computational effects by ⊤⊤-lifting (2013)
- The criterion package (0.8.0.0) (2013)
- Programming with algebraic effects and handlers (2012)
- MRI: Modular reasoning about interference in incremental programming (2012)
- The mtl package (2.1.2) (2012)
- pipes-2.5: Faster and slimmer (2012)
- Iteratees (2012)
- Row-based effect types for database integration (2012)
- Frank (0.3) (Hackage package) (2012)
- The effects package (0.2.2) (Hackage package) (2012)
- Monads, zippers and views (2011)
- Lightweight monadic programming in ML (2011)
- Monads in action (2010)
- Monad transformers as monoid transformers (2010)
- A Generic Operational Metatheory for Algebraic Effects (2010)
- Embedded Probabilistic Programming (2009)
- Handlers of Algebraic Effects (2009)
- Two Cotensors in One: Presentations of Algebraic Theories for Local State and Fresh Names (2009)
- Exception Handlers as Extensible Cases (2008)
- Monatron: An extensible monad transformer library (2008)
- Data types à la carte (2008)
- Asymptotic Improvement of Computations over Free Monads (2008)
- A type-theoretic foundation of delimited continuations (2007)
- Extensional rewriting with sums (2007)
- Why it's nice to be quoted (2007)
- A static simulation of dynamic delimited control (2007)
- Combining effects: Sum and tensor (2006)
- Call-By-Push-Value: A Functional/Imperative Synthesis (2004)
- Algebraic Operations and Generic Effects (2003)
- Notions of computation determine monads (2002)
- Template meta-programming for Haskell (2002)
- Exceptional syntax (2001)
- Adequacy for algebraic effects (2001)
- Monads and effects (2000)
- Type-based analysis of uncaught exceptions (2000)
- Representing layered monads (1999)
- Functional programming with overloading and higher-order polymorphism (1995)
- Monad transformers and modular interpreters (1995)
- Monads for functional programming (1995)
- Type inference for records in a natural extension of ML (1993)
- Abstracting control (1990)
- Computational lambda-calculus and monads (1989)
- The theory and practice of first-class prompts (1988)