Reference. Scoped Effects as Parameterized Algebraic Theories
Notions of computation can be modelled by monads. Algebraic effects offer a characterization of monads in terms of algebraic operations and equational axioms, where operations are basic programming features, such as reading or updating the state, and axioms specify observably equivalent expressions. However, many useful programming features depend on additional mechanisms such as delimited scopes or dynamically allocated resources. Such mechanisms can be supported via extensions to algebraic effects including scoped effects and parameterized algebraic theories . We present a fresh perspective on scoped effects by translation into a variation of parameterized algebraic theories. The translation enables a new approach to equational reasoning for scoped effects and gives rise to an alternative characterization of monads in terms of generators and equations involving both scoped and algebraic operations. We demonstrate the power of our fresh perspective by way of equational characterizations of several known models of scoped effects.
Cite
Cited by (1)
Scoped Effects, Scoped Operations, and Parameterized Algebraic Theories matache-2025-scoped
Notions of computation can be modeled by monads. Algebraic effects offer a characterization of monads in terms of algebraic operations and equational axioms, where operations are basic programming features, such as reading or updating the state, and axioms specify observably equivalent expressions. However, many useful programming features depend on additional mechanisms such as delimited scopes or dynamically allocated resources. Such mechanisms can be supported via extensions to algebraic effects including scoped effects and parameterized algebraic theories . We present a fresh perspective on scoped effects by translation into a variation of parameterized algebraic theories. The translation enables a new approach to equational reasoning for scoped effects and gives rise to an alternative characterization of monads in terms of generators and equations involving both scoped and algebraic operations. We demonstrate the power of our approach by way of equational characterizations of several known models of scoped effects.
Cites 46 works (5 here)
With notes (5)
Modular Models of Monoids with Operations yang-2023-modular
Inspired by algebraic effects and the principle of notions of computations as monoids, we study a categorical framework for equational theories and models of monoids equipped with operations. The framework covers not only algebraic operations but also scoped and variable-binding operations. Appealingly, in this framework both theories and models can be modularly composed. Technically, a general monoid-theory correspondence is shown, saying that the category of theories of algebraic operations is equivalent to the category of monoids. Moreover, more complex forms of operations can be coreflected into algebraic operations, in a way that preserves initial algebras. On models, we introduce modular models of a theory, which can interpret abstract syntax in the presence of other operations. We show constructions of modular models (i) from monoid transformers, (ii) from free algebras, (iii) by composition, and (iv) in symmetric monoidal categories.
Formal metatheory of second-order abstract syntax fiore-2022-formal
Despite extensive research both on the theoretical and practical fronts, formalising, reasoning about, and implementing languages with variable binding is still a daunting endeavour – repetitive boilerplate and the overly complicated metatheory of capture-avoiding substitution often get in the way of progressing on to the actually interesting properties of a language. Existing developments offer some relief, however at the expense of inconvenient and error-prone term encodings and lack of formal foundations. We present a mathematically-inspired language-formalisation framework implemented in Agda. The system translates the description of a syntax signature with variable-binding operators into an intrinsically-encoded, inductive data type equipped with syntactic operations such as weakening and substitution, along with their correctness properties. The generated metatheory further incorporates metavariables and their associated operation of metasubstitution, which enables second-order equational/rewriting reasoning. The underlying mathematical foundation of the framework – initial algebra semantics – derives compositional interpretations of languages into their models satisfying the semantic substitution lemma by construction.
Structured Handling of Scoped Effects yang-2022-structured
Algebraic effects offer a versatile framework that covers a wide variety of effects. However, the family of operations that delimit scopes are not algebraic and are usually modelled as handlers, thus preventing them from being used freely in conjunction with algebraic operations. Although proposals for scoped operations exist, they are either ad-hoc and unprincipled, or too inconvenient for practical programming. This paper provides the best of both worlds: a theoretically-founded model of scoped effects that is convenient for implementation and reasoning. Our new model is based on an adjunction between a locally finitely presentable category and a category of functorial algebras . Using comparison functors between adjunctions, we show that our new model, an existing indexed model, and a third approach that simulates scoped operations in terms of algebraic ones have equal expressivity for handling scoped operations. We consider our new model to be the sweet spot between ease of implementation and structuredness. Additionally, our approach automatically induces fusion laws of handlers of scoped effects, which are useful for reasoning and optimisation.
Linear logic girard_linear_1987
The familiar connective of negation is broken into two operations: linear negation which is the purely negative part of negation and the modality “of course” which has the meaning of a reaffirmation. Following this basic discovery, a completely new approach to the whole area between constructive logics and programmation is initiated.
Functorial Semantics of Algebraic Theories lawvere_1963
External (41)
- Scoped effects as parameterized algebraic theories (2024)
- A Calculus for Scoped Effects & Handlers (2023)
- A Framework for Higher-Order Effects & Handlers (2023)
- Flexible presentations of graded monads (2022)
- Fusing industry and academia at GitHub (experience report) (2022)
- What is algebraic about algebraic effects and handlers? (2018)
- Syntax and Semantics for Operations with Scopes (2018)
- The Beta-Bernoulli process and algebraic effects (2018)
- Backtracking with cut via a distributive law and left-zero monoids (2017)
- Guarded Dependent Type Theory with Coinductive Types (2016)
- Algebraic effects, linearity, and quantum programming languages (2015)
- Substitution, jumps, and algebraic effects (2014)
- Local States in String Diagrams (2014)
- Freyd categories are Enriched Lawvere Theories (2014)
- Effect handlers in scope (2014)
- Handling Algebraic Effects (2013)
- An Algebraic Presentation of Predicate Logic - (Extended Abstract) (2013)
- Instances of Computational Effects: An Algebraic Perspective (2013)
- Structural recursion with locally scoped names (2011)
- Second-Order Equational Logic (Extended Abstract) (2010)
- Second-Order Algebraic Theories - (Extended Abstract) (2010)
- Segal Condition Meets Computational Effects (2010)
- Free-algebra models for the π-calculus (2008)
- Combining effects: Sum and tensor (2006)
- Semantics for Local Computational Effects (2006)
- Explicit substitutions and higher-order syntax (2006)
- Computational effects and operations: an overview (2004)
- A type theory for memory allocation and data layout (2003)
- Algebraic Operations and Generic Effects (2003)
- Notions of Computation Determine Monads (2002)
- Adequacy for Algebraic Effects (2001)
- Ordered linear logic and applications (2001)
- Communicating and mobile systems: the π-calculus (1999)
- Enriched Lawvere theories (1999)
- Linear logic, monads and the lambda calculus (1996)
- Domain theory (1994)
- Adjunctions whose counits are coequalizers, and presentations of finitary enriched monads (1993)
- Notions of Computation and Monads (1991)
- Computational lambda-calculus and monads (1989)
- On closed categories of functors (1970)
- Some Aspects of Equational Categories (1966)