Combining effects and coeffects via grading
Combining effects and coeffects via grading
复制标题
通过分级结合效应和协同效应
DOI:
10.1145/2951913.2951939
复制
发表时间:
2016
期刊:
影响因子:
--
通讯作者:
Gaboardi M
中科院分区:
文献类型:
--
作者:
Gaboardi M
Effects and coeffects are two general, complementary aspects of program behaviour. They roughly correspond to computations which change the execution context (effects) versus computations which make demands on the context (coeffects). Effectful features include partiality, non-determinism, input-output, state, and exceptions. Coeffectful features include resource demands, variable access, notions of linearity, and data input requirements. The effectful or coeffectful behaviour of a program can be captured and described via type-based analyses, with fine grained information provided by monoidal effect annotations and semiring coeffects. Various recent work has proposed models for such typed calculi in terms of graded (strong) monads for effects and graded (monoidal) comonads for coeffects. Effects and coeffects have been studied separately so far, but in practice many computations are both effectful and coeffectful, e.g., possibly throwing exceptions but with resource requirements. To remedy this, we introduce a new general calculus with a combined effect-coeffect system. This can describe both the changes and requirements that a program has on its context, as well as interactions between these effectful and coeffectful features of computation. The effect-coeffect system has a denotational model in terms of effect-graded monads and coeffect-graded comonads where interaction is expressed via the novel concept of graded distributive laws. This graded semantics unifies the syntactic type theory with the denotational model. We show that our calculus can be instantiated to describe in a natural way various different kinds of interaction between a program and its evaluation context.
登录
查看更多内容
DOI:
--
发表时间:
1998
期刊:
ACM SIGPLAN International Conference on Functional Programming
影响因子:
--
作者:
Jennifer S Peel;M. Mcnarry;S. Heffernan;V. Nevola;L. Kilduff;M. Waldron
通讯作者:
M. Waldron
DOI:
--
发表时间:
2001
期刊:
Proceedings 16th Annual IEEE Symposium on Logic in Computer Science
影响因子:
--
作者:
K. Terui
通讯作者:
K. Terui
DOI:
--
发表时间:
2017
期刊:
影响因子:
--
作者:
T. Petříček
通讯作者:
T. Petříček
DOI:
--
发表时间:
2013
期刊:
影响因子:
--
作者:
Danel Ahman;Tarmo Uustalu
通讯作者:
Tarmo Uustalu
DOI:
--
发表时间:
2005
期刊:
Asian Symposium on Programming Languages and Systems
影响因子:
--
作者:
Tarmo Uustalu;Varmo Vene
通讯作者:
Varmo Vene