Polymorphic Delimited Continuations

  • Kenichi Asai
  • Yukiyoshi Kameyama
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4807)


This paper presents a polymorphic type system for a language with delimited control operators, shift and reset. Based on the monomorphic type system by Danvy and Filinski, the proposed type system allows pure expressions to be polymorphic. Thanks to the explicit presence of answer types, our type system satisfies various important properties, including strong type soundness, existence of principal types and an inference algorithm, and strong normalization. Relationship to CPS translation as well as extensions to impredicative polymorphism are also discussed. These technical results establish the foundation of polymorphic delimited continuations.


Type System Delimited Continuation Control Operator CPS Translation Predicative/Impredicative Polymorphism 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Asai, K.: Logical Relations for Call-by-value Delimited Continuations. Trends in Functional Programming 6, 63–78 (2007)Google Scholar
  2. 2.
    Asai, K.: On Typing Delimited Continuations: Three New Solutions to the Printf Problem. See (submitted, 2007)
  3. 3.
    Asai, K., Kameyama, Y.: Polymorphic Delimited Continuations. Technical Report CS-TR-07-10, Dept. of Computer Science, University of Tsukuba (September 2007)Google Scholar
  4. 4.
    Danvy, O.: An Analytical Approach to Program as Data Objects. DSc thesis, Department of Computer Science, University of Aarhus, Aarhus, Denmark (2006)Google Scholar
  5. 5.
    Danvy, O., Filinski, A.: A Functional Abstraction of Typed Contexts. Technical Report 89/12, DIKU, University of Copenhagen (July 1989)Google Scholar
  6. 6.
    Danvy, O., Filinski, A.: Abstracting Control. In: Proc. 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160 (1990)Google Scholar
  7. 7.
    Danvy, O., Filinski, A.: Representing Control: a Study of the CPS Transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)zbMATHMathSciNetGoogle Scholar
  8. 8.
    Filinski, A.: Representing Monads. In: POPL, pp. 446–457 (1994)Google Scholar
  9. 9.
    Girard, J.-Y., Lafont, Y., Taylor, P.: Proofs and Types. Cambridge Tracts in Theoretical Computer Science, vol. 7. Cambridge University Press, Cambridge (1989)zbMATHGoogle Scholar
  10. 10.
    Gunter, C.A., Remy, D., Riecke, J.G.: A Generalization of Exceptions and Control in ML-Like Languages. In: FPCA, pp. 12–23 (1995)Google Scholar
  11. 11.
    Harper, R., Duba, B.F., MacQueen, D.: Typing First-Class Continuations in ML. J. Funct. Program. 3(4), 465–484 (1993)CrossRefGoogle Scholar
  12. 12.
    Harper, R., Lillibridge, M.: Explicit polymorphism and CPS conversion. In: POPL, pp. 206–219 (1993)Google Scholar
  13. 13.
    Hasegawa, M.: Relational parametricity and control. Logical Methods in Computer Science 2(3) (2006)Google Scholar
  14. 14.
    Kiselyov, O., Shan, C.-c., Sabry, A.: Delimited dynamic binding. In: ICFP, pp. 26–37 (2006)Google Scholar
  15. 15.
    Leroy, X.: Polymorphism by name for references and continuations. In: POPL, pp. 220–231 (1993)Google Scholar
  16. 16.
    Mogelberg, R.E., Simpson, A.: Relational parametricity for computational effects. In: LICS (2007)Google Scholar
  17. 17.
    Strachey, C.: Fundamental concepts in programming languages. International Summer School in Computer Programming, Copenhagen, Denmark (August 1967)Google Scholar
  18. 18.
    Thielecke, H.: From Control Effects to Typed Continuation Passing. In: POPL, pp. 139–149. ACM Press, New York (2003)Google Scholar
  19. 19.
    Tofte, M.: Type inference for polymorphic references. Inf. Comput. 89(1), 1–34 (1990)zbMATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Wright, A.K.: Simple imperative polymorphism. Lisp and Symbolic Computation 8(4), 343–355 (1995)CrossRefGoogle Scholar
  21. 21.
    Wright, A.K., Felleisen, M.: A syntactic approach to type soundness. Inf. Comput. 115(1), 38–94 (1994)zbMATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2007

Authors and Affiliations

  • Kenichi Asai
    • 1
  • Yukiyoshi Kameyama
    • 2
  1. 1.Department of Information Science, Ochanomizu University 
  2. 2.Department of Computer Science, University of Tsukuba 

Personalised recommendations