Skip to main content

Coeffects: A calculus of context-dependent computation

Petricek, Tomas, Orchard, Dominic A., Mycroft, Alan (2014) Coeffects: A calculus of context-dependent computation. In: Proceedings of the 19th ACM SIGPLAN international conference on Functional programming. . pp. 123-135. ACM, New York USA, New York ISBN 978-1-4503-2873-9. (doi:10.1145/2628136.2628160) (KAR id:57493)

PDF Pre-print
Language: English
Download (352kB) Preview
[thumbnail of paper.pdf]
This file may not be suitable for users of assistive technology.
Request an accessible format
Official URL


The notion of context in functional languages no longer refers just to variables in scope. Context can capture additional properties of variables (usage patterns in linear logics; caching requirements in dataflow languages) as well as additional resources or properties of the execution environment (rebindable resources; platform version in a cross-platform application). The recently introduced notion of coeffects captures the latter, whole-context properties, but it failed to capture fine-grained per-variable properties.

We remedy this by developing a generalized coeffect system with annotations indexed by a coeffect shape. By instantiating a concrete shape, our system captures previously studied flat (whole-context) coeffects, but also structural (per-variable) coeffects, making coeffect analyses more useful. We show that the structural system enjoys desirable syntactic properties and we give a categorical semantics using extended notions of indexed comonad.

The examples presented in this paper are based on analysis of established language features (liveness, linear logics, dataflow, dynamic scoping) and we argue that such context-aware properties will also be useful for future development of languages for increasingly heterogeneous and distributed platforms.

Item Type: Conference or workshop item (Paper)
DOI/Identification number: 10.1145/2628136.2628160
Subjects: Q Science > QA Mathematics (inc Computing science) > QA 9 Formal systems, logics
Divisions: Divisions > Division of Computing, Engineering and Mathematical Sciences > School of Computing
Depositing User: Dominic Orchard
Date Deposited: 28 Sep 2016 13:02 UTC
Last Modified: 23 Mar 2021 10:18 UTC
Resource URI: (The current URI for this page, for reference purposes)
Petricek, Tomas:
Orchard, Dominic A.:
  • Depositors only (login required):


Downloads per month over past year