From control effects to typed continuation passing

Hayo Thielecke
2003 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages - POPL '03  
First-class continuations are a powerful computational effect, allowing the programmer to express any form of jumping. Types and effect systems can be used to reason about continuations, both in the source language and in the target language of the continuation-passing transform. In this paper, we establish the connection between an effect system for first-class continuations and typed versions of continuationpassing style. A region in the effect system determines a local answer type for
more » ... ations, such that the continuation transforms of pure expressions are parametrically polymorphic in their answer types. We use this polymorphism to derive transforms that make use of effect information, in particular, a mixed linear/non-linear continuation-passing transform, in which expressions without control effects are passed their continuations linearly.
doi:10.1145/604131.604144 fatcat:igs5ohvj7rhb3d7k6ne4mlqa4u