First-class names for effect handlers
Ningning Xie, Youyou Cong, Kazuki Ikemori, Daan Leijen
摘要
Algebraic effects and handlers are a promising technique for incorporating composable computational effects into functional programming languages. Effect handlers enable concisely programming with different effects, but they do not offer a convenient way to program with different instances of the same effect. As a solution to this inconvenience, previous studies have introduced named effect handlers, which allow the programmer to distinguish among different effect instances. However, existing formalizations of named handlers are both involved and restrictive, as they employ non-standard mechanisms to prevent the escaping of handler names. In this paper, we propose a simple and flexible design of named handlers. Specifically, we treat handler names as first-class values, and prevent their escaping while staying within the ordinary λ-calculus. Such a design is enabled by combining named handlers with scoped effects, a novel variation of effects that maintain a scope via rank-2 polymorphism. We formalize two combinations of named handlers and scoped effects, and implement them in the Koka programming language. We also present practical applications of named handlers, including a neural network and a unification algorithm.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 8 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Lexical Effect Handlers, Directly 引用了 Continuing WebAssembly with Effect Handlers
- Lexical Effect Handlers, Directly 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
- Lexical Effect Handlers, Directly 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Modal Effect Types 引用了 Continuing WebAssembly with Effect Handlers
- Modal Effect Types 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
- Modal Effect Types 引用了 Soundly Handling Linearity
- Modal Effect Types 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Zero-Overhead Lexical Effect Handlers 引用了 Lexical Effect Handlers, Directly
- Zero-Overhead Lexical Effect Handlers 引用了 Continuing WebAssembly with Effect Handlers
- Zero-Overhead Lexical Effect Handlers 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
- Zero-Overhead Lexical Effect Handlers 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Effects as capabilities: effect handlers and lightweight effect polymorphism 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Soundly Handling Linearity 引用了 Continuing WebAssembly with Effect Handlers
- Soundly Handling Linearity 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
- Soundly Handling Linearity 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
引用它的顶会 Paper8
- Continuing WebAssembly with Effect HandlersLuna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen 等OOPSLA 2023 · 20 次引用
- Soundly Handling LinearityWenhao Tang, Daniel Hillerström, Sam Lindley, J. Garrett MorrisPOPL 2024 · 8 次引用
- Lexical Effect Handlers, DirectlyCong Ma, Zhaoyi Ge, Edward Lee, Yizhou ZhangOOPSLA 2024 · 7 次引用
- Modal Effect TypesWenhao Tang, Leo White, Stephen Dolan, Daniel Hillerström 等OOPSLA 2025 · 4 次引用
- Zero-Overhead Lexical Effect HandlersCong Ma, Zhaoyi Ge, Max Jung, Yizhou ZhangOOPSLA 2025 · 2 次引用
它引用的 Paper3
- Effects as capabilities: effect handlers and lightweight effect polymorphismJonathan Immanuel Brachthäuser, Philipp Schuster, Klaus OstermannOOPSLA 2020 · 62 次引用
- Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 次引用
- Perceus: garbage free reference counting with reuseAlex Reinking, Ningning Xie, Leonardo de Moura, Daan LeijenPLDI 2021 · 31 次引用
相关 Paper
- Hefty Algebras: Modular Elaboration of Higher-Order Algebraic EffectsCasper Bach Poulsen, Cas van der RestPOPL 2023 · 9 次引用
- Dynamic Wind for Effect HandlersDavid Voigt, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025
- Tracing Just-in-Time Compilation for Effects and HandlersMarcial Gaißert, Carl Friedrich Bolz-Tereick, Jonathan Immanuel BrachthäuserOOPSLA 2025
- Efficient compilation of algebraic effect handlersGeorgios Karachalias, Filip Koprivec, Matija Pretnar, Tom SchrijversOOPSLA 2021 · 9 次引用
- Rows and Capabilities as Modal EffectsWenhao Tang, Sam LindleyPOPL 2026 · 1 次引用
