Gradual Typing for Effect Handlers
Max S. New, Eric Giovannini, Daniel R. Licata
Abstract
We present a gradually typed language, GrEff, with effects and handlers that supports migration from unchecked to checked effect typing. This serves as a simple model of the integration of an effect typing discipline with an existing effectful typed language that does not track fine-grained effect information. Our language supports a simple module system to model the programming model of gradual migration from unchecked to checked effect typing in the style of Typed Racket.
The surface language GrEff is given semantics by elaboration to a core language Core GrEff. We equip Core GrEff with an inequational theory for reasoning about the semantic error ordering and desired program equivalences for programming with effects and handlers. We derive an operational semantics for the language from the equations provable in the theory. We then show that the theory is sound by constructing an operational logical relations model to prove the graduality theorem. This extends prior work on embedding-projection pair models of gradual typing to handle effect typing and subtyping.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext c15d8d77-dbb6-4dd8-8cff-3c3c2dc55464Cited by top-tier papers3
- Modal Effect TypesWenhao Tang, Leo White, Stephen Dolan, Daniel Hillerström et al.OOPSLA 2025 · 4 citations
- Denotational Semantics of Gradual Typing using Synthetic Guarded Domain TheoryEric Giovannini, Tingting Ding, Max S. NewPOPL 2025 · 2 citations
- Backwards-Compatible Row-Based Exceptions in MLSimcha van Collem, Paulo Emílio de Vilhena, Robbert KrebbersPLDI 2026
Builds on3
- Retrofitting effect handlers onto OCamlK. C. Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly et al.PLDI 2021 · 56 citations
- Graduality and parametricity: together again for the first timeMax S. New, Dustin Jamner, Amal AhmedPOPL 2020 · 36 citations
- Gradually structured dataStefan Malewski, Michael Greenberg, Éric TanterOOPSLA 2021 · 4 citations
Related papers
- Abstracting gradual typing moving forward: precise and space-efficientFelipe Bañados Schwerter, Alison M. Clark, Khurram A. Jafery, Ronald GarciaPOPL 2021 · 13 citations
- A relational theory of effects and coeffectsUgo Dal Lago, Francesco GavazzoPOPL 2022 · 22 citations
- Handling Higher-Order Effectful Operations with Judgemental Monadic LawsZhixuan Yang, Nicolas WuPOPL 2026
- Gradually Typed Languages Should Be Vigilant!Olek Gierczak, Lucy Menon, Christos Dimoulas, Amal AhmedOOPSLA 2024 · 1 citation
- Effects as capabilities: effect handlers and lightweight effect polymorphismJonathan Immanuel Brachthäuser, Philipp Schuster, Klaus OstermannOOPSLA 2020 · 62 citations
