Associated Effects: Flexible Abstractions for Effectful Programming
Matthew Lutze, Magnus Madsen
Abstract
We present associated effects, a programming language feature that enables type classes to abstract over the effects of their function signatures, allowing each type class instance to specify its concrete effects. Associated effects significantly increase the flexibility and expressive power of a programming language that combines a type and effect system with type classes. In particular, associated effects allow us to (i) abstract over total and partial functions, where partial functions may throw exceptions, (ii) abstract over immutable data structures and mutable data structures that have heap effects, and (iii) implement adaptors that combine type classes with algebraic effects. We implement associated effects as an extension of the Flix programming language and refactor the Flix Standard Library to use associated effects, significantly increasing its flexibility and expressive power. Specifically, we add associated effects to 11 type classes, which enables us to add 28 new type class instances. CCS Concepts: • Software and its engineering → Language features .
Ask about this paper
Ask your agent about it.
Lune has read the top-tier papers around this one, so every answer names the papers it rests on.
Your agent calls
Lunesearch_papers
Free to start. No credit card required.
Terminal
Install the CLIlune papers get 940e00de-d30d-4c0f-ad5c-416a6ff528a1Cited by top-tier papers3
- A Lightweight Type-and-Effect System for Invalidation Safety: Tracking Permanent and Temporary Invalidation with Constraint-Based Subtype InferenceCunyuan Gao, Lionel ParreauxOOPSLA 2025 · 4 citations
- What's in the Box: Ergonomic and Expressive Capture Tracking over Generic Data StructuresYichen Xu, Oliver Bracevac, Cao Nguyen Pham, Martin OderskyOOPSLA 2025 · 4 citations
- Qualified Types with Boolean AlgebrasEdward Lee, Jonathan Lindegaard Starup, Ondrej Lhoták, Magnus MadsenOOPSLA 2025 · 1 citation
Related papers
- Polymorphic types and effects with Boolean unificationMagnus Madsen, Jaco van de PolOOPSLA 2020 · 18 citations
- Fighting Supply Chain Attacks with Effect SystemsMagnus Madsen, Andreas Stenbæk Larsen, Jakob Schneider Villumsen, Aslan AskarovOOPSLA 2026
- Fuzzing channel-based concurrency runtimes using types and effectsQuentin Stiévenart, Magnus MadsenOOPSLA 2020 · 2 citations
- Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 citations
- Flix: A Design for Language-Integrated DatalogMagnus Madsen, Ondrej LhotákOOPSLA 2025
