English

Handling Algebraic Effects

Logic in Computer Science 2015-07-01 v2 Programming Languages

Abstract

Algebraic effects are computational effects that can be represented by an equational theory whose operations produce the effects at hand. The free model of this theory induces the expected computational monad for the corresponding effect. Algebraic effects include exceptions, state, nondeterminism, interactive input/output, and time, and their combinations. Exception handling, however, has so far received no algebraic treatment. We present such a treatment, in which each handler yields a model of the theory for exceptions, and each handling construct yields the homomorphism induced by the universal property of the free model. We further generalise exception handlers to arbitrary algebraic effects. The resulting programming construct includes many previously unrelated examples from both theory and practice, including relabelling and restriction in Milner's CCS, timeout, rollback, and stream redirection.

Keywords

Cite

@article{arxiv.1312.1399,
  title  = {Handling Algebraic Effects},
  author = {Gordon D Plotkin and Matija Pretnar},
  journal= {arXiv preprint arXiv:1312.1399},
  year   = {2015}
}

Comments

36 pages

R2 v1 2026-06-22T02:21:13.746Z