Presented at POPL 2026.
A hyperfunction is a continuation-like construction that can be used to implement communication in the context of concurrency. Though it has been reinvented many times, it remains somewhat obscure: since its definition by Launchbury et al. [2000], hyperfunctions have been used to implement algebraic effects [Kammar et al. 2013], coroutines [Spivey 2017], and breadth-first traversals [Berger et al. 2019]; however, in each of these examples, the hyperfunction type went unrecognised. We identify the hyperfunctions hidden in all of these algorithms, and we exposit the common pattern between them, building a framework for working with and reasoning about hyperfunctions. We use this framework to solve a long-standing problem: giving a fully-abstract continuation-based semantics for a concurrent calculus, the Calculus of Communicating Systems. Finally, we use hyperfunctions to build a monadic Haskell library for efficient first-class coroutines.
Bibtex:
@article{kidney_hyperfunctions_2026,
title = {Hyperfunctions: {{Communicating Continuations}}},
shorttitle = {Hyperfunctions},
author = {Kidney, Donnacha Ois{\'i}n and Wu, Nicolas},
year = 2026,
month = jan,
journal = {Proc. ACM Program. Lang.},
volume = {10},
number = {POPL},
pages = {7:174--7:203},
doi = {10.1145/3776649},
urldate = {2026-02-18},
abstract = {A hyperfunction is a continuation-like construction that can be used to implement communication in the context of concurrency. Though it has been reinvented many times, it remains somewhat obscure: since its definition by Launchbury et al., hyperfunctions have been used to implement certain algebraic effect handlers, coroutines, and breadth-first traversals; however, in each of these examples, the hyperfunction type went unrecognised. We identify the hyperfunctions hidden in all of these algorithms, and we exposit the common pattern between them, building a framework for working with and reasoning about hyperfunctions. We use this framework to solve a long-standing problem: giving a fully-abstract continuation-based semantics for a concurrent calculus, the Calculus of Communicating Systems. Finally, we use hyperfunctions to build a monadic Haskell library for efficient first-class coroutines.}
}