Structured Handling of Scoped Effects: Extended Version

01/25/2022
by   Zhixuan Yang, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/14/2022

Category-Graded Algebraic Theories and Effect Handlers

We provide an effect system CatEff based on a category-graded extension ...
research
01/12/2023

Algebraic Model Management: A Survey

We survey the field of model management and describe a new model managem...
research
05/27/2020

Local Algebraic Effect Theories

Algebraic effects are computational effects that can be described with a...
research
04/19/2023

A Calculus for Scoped Effects Handlers

Algebraic effects handlers have become a standard approach for side-...
research
05/18/2021

Parametricity and Semi-Cubical Types

We construct a model of type theory enjoying parametricity from an arbit...
research
03/07/2022

Handling Higher-Order Effects

Algebraic effect handlers is a programming paradigm where programmers ca...
research
01/22/2022

Beyond Nonexpansive Operations in Quantitative Algebraic Reasoning

The framework of quantitative equational logic has been successfully app...

Please sign up or login with your details

Forgot password? Click here to reset