Effect Systems as a Mechanism for Managing Contextual Free Variables: A Unifying Perspective


Effect Systems as a Mechanism for Managing Contextual Free Variables: A Unifying Perspective

Stoyan A.S. (NRU HSE, Moscow, Russia)

Abstract

Effect systems lift information about a program’s computational effects to the type level: they sharpen abstraction boundaries and let the compiler verify that an effectful computation runs in a context that supports it. Nevertheless, static effect tracking has not yet become common practice: the leading approaches – effect rows, capabilities, and modal types – are usually described using different technical machinery, and a language designer struggles to see the overall design space. We propose a unifying perspective: an effect system is a mechanism for managing the contextual free variables of a computation – dependencies that are not passed as ordinary arguments but must be resolved by the execution context. Such a variable goes through a lifecycle of two phases: it arises pending, with an unresolved contextual requirement; once resolved, the dependency can be retained inside a value – either literally, by capturing a witness, or more broadly, as a dependency on its construction context. Families of effect systems differ in which phases and transitions of this lifecycle they support and how they reflect them in types. Classical row-based systems keep the variables pending and cannot express capture. Capability-based systems allow capture but confine a captured variable to the context that provided it by means of escape analysis. Modal systems, instead of forbidding the escape, uncapture an escaping variable, re-exposing it in the type as a contextual requirement. Comparing the families along this single lifecycle axis shows that the choice of supported transitions predetermines the remaining traits of the discipline – from the kind of polymorphism required to the placement of annotations – thus giving the language designer a map of the design space.

Keywords

effect systems; computational effects; contextual free variables; free variables; implicit parameters; escape analysis; capabilities; effect rows; modal types; type systems; contextual polymorphism.

Edition

Proceedings of the Institute for System Programming, vol. 38, issue 4, part 1, 2026, pp. 69-88

ISSN 2220-6426 (Online), ISSN 2079-8156 (Print).

DOI: 10.15514/ISPRAS-2026-38(4)-4

For citation

Stoyan A.S. Effect Systems as a Mechanism for Managing Contextual Free Variables: A Unifying Perspective. Proceedings of the Institute for System Programming, vol. 38, issue 4, part 1, 2026, pp. 69-88 DOI: 10.15514/ISPRAS-2026-38(4)-4.

Full text of the paper in pdf (in Russian) Back to the contents of the volume