Hostname: page-component-6766d58669-76mfw Total loading time: 0 Render date: 2026-05-21T03:03:25.735Z Has data issue: false hasContentIssue false

Hefty algebras: Modular elaboration of higher-order effects

Part of: POPL 23

Published online by Cambridge University Press:  02 February 2026

CAS VAN DER REST
Affiliation:
Shielded Technologies, London, UK (e-mail: cas.vanderrest@shielded.io)
CASPER BACH
Affiliation:
University of Southern Denmark, Odense, Denmark Delft University of Technology, Delft, Netherlands (e-mail: casperbach@imada.sdu.dk)
Rights & Permissions [Opens in a new window]

Abstract

Algebraic effects and handlers is an increasingly popular paradigm for programming with effects. A key benefit is modularity: programs with effects are defined against an interface of operations, allowing the implementation of effects to be defined and refined without changing or recompiling programs. The behavior of effects is specified using equational theories, with equational proofs inheriting the same modularity. However, higher-order operations (that take computations as arguments) break this modularity: while they can often be encoded in terms of algebraic effects, this typically breaks modularity as operations defined this way are not encapsulated in an interface, inducing changes to programs and proofs upon refinement of the implementation. In this paper, we show that syntactic overloading is a viable solution to this modularity problem by defining hefty algebras: a formal framework that captures an overloading-based semantics of higher-order effects by defining modular elaborations from higher-order effect trees into primitive algebraic effects. We demonstrate how this approach scales to define a wide range of known higher-order effects from the literature and develop modular higher-order effect theories and modular reasoning principles that build on and extend the state of the art in modular algebraic effect theories. We formalize our contributions in Agda.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2026. Published by Cambridge University Press
Figure 0

Fig 1. A state effect (upper), its handler ( below), and a simple test (, also below) which uses (the elided) smart constructors for and .

Figure 1

Fig 2. A higher-order censor effect and operation, with a single computation parameter (declared with in the effect signature top right) with return type (declared with top right).

Figure 2

Fig 3. Higher-order effect signature of $\lambda$ abstraction and application.

Figure 3

Fig 4. Effect signature of the sub/jump effect.

Figure 4

Fig 5. Effect signature of the choice effect.

Figure 5

Fig 6. Higher-order effect signature of the once effect.

Figure 6

Fig 7. Higher-order effect signature of the concur effect.

Figure 7

Fig 8. The central correctness theorem, which establishes that correctness of elaborations is preserved under composition.

Figure 8

Table 1 Overview of effects, their operations, and verified laws in the Agda code

Submit a response

Discussions

No Discussions have been published for this article.