Subtyping delimited continuations
Subtyping delimited continuations
复制标题
子类型化分隔延续
DOI:
10.1145/2034773.2034786
复制
发表时间:
2011
期刊:
影响因子:
--
通讯作者:
Dariusz Biernacki
中科院分区:
文献类型:
--
作者:
Marek Materzok;Dariusz Biernacki
We present a type system with subtyping for first-class delimited continuations that generalizes Danvy and Filinski's type system for shift and reset by maintaining explicit information about the types of contexts in the metacontext. We exploit this generalization by considering the control operators known as shift0 and reset0 that can access arbitrary contexts in the metacontext. We use subtyping to control the level of information about the metacontext the expression actually requires and in particular to coerce pure expressions into effectful ones. For this type system we prove strong type soundness and termination of evaluation and we present a provably correct type reconstruction algorithm. We also introduce two CPS translations for shift0 and reset0: one targeting the untyped lambda calculus, and another - type-directed - targeting the simply-typed lambda calculus. The latter translation preserves typability and is selective in that it keeps pure expressions in direct style.