Answer Type Polymorphism in Call-by-Name Continuation Passing

  • Hayo Thielecke
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2986)


This paper studies continuations by means of a polymorphic type system. The traditional call-by-name continuation passing style transform admits a typing in which some answer types are polymorphic, even in the presence of first-class control operators. By building on this polymorphic typing, and using parametricity reasoning, we show that the call-by-name transform satisfies the eta-law, and is in fact isomorphic to the more recent CPS transform defined by Streicher.


Control Operator Function Type Target Language Source Language Calling Context 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    Berdine, J., O’Hearn, P.W., Reddy, U., Thielecke, H.: Linear continuation passing. Higher-order and Symbolic Computation 15(2/3), 181–208 (2002)zbMATHCrossRefGoogle Scholar
  2. 2.
    Danvy, O., Filinski, A.: Representing control, a study of the CPS transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Danvy, O., Hatcliff, J.: A generic account of continuation-passing styles. In: ACM Symposium on Principles of Programming Languages, pp. 458–471 (1994)Google Scholar
  4. 4.
    Filinski, A.: Declarative continuations: an investigation of duality in programming language semantics. In: Dybjer, P., Pitts, A.M., Pitt, D.H., Poigné, A., Rydeheard, D.E. (eds.) Category Theory and Computer Science. LNCS, vol. 389, pp. 224–249. Springer, Heidelberg (1989)CrossRefGoogle Scholar
  5. 5.
    Griffin, T.G.: A formulae-as-types notion of control. In: Principles of Programming Languages (POPL 1990), pp. 47–58. ACM, New York (1990)Google Scholar
  6. 6.
    Harper, R., Lillibridge, M.: Explicit polymorphism and CPS conversion. In: Principles of Programming Languages (POPL 1993), pp. 206–219. ACM, New York (1993)Google Scholar
  7. 7.
    Hatcliff, J., Danvy, O.: Thunks and the λ-calculus. Journal of Functional Programming 7(2), 303–319 (1997)zbMATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Hofmann, M., Streicher, T.: Continuation models are universal for λμ-calculus. In: LICS: IEEE Symposium on Logic in Computer Science (1997)Google Scholar
  9. 9.
    Jouvelot, P., Gifford, D.K.: Reasoning about continuations with control effects. In: Prgramming Language Design and Implementation (PLDI), pp. 218–226. ACM, New York (1988)Google Scholar
  10. 10.
    Kelsey, R., Clinger, W., Rees, J. (eds.): Revised5 report on the algorithmic language Scheme. Higher-Order and Symbolic Computation 11(1), 7–105 (1998)Google Scholar
  11. 11.
    Laurent, O., Regnier, L.: About translations of classical logic into polarized linear logic. In: Proceedings of the eighteenth annual IEEE symposium on Logic in Computer Science, June 2003, pp. 11–20. IEEE Computer Society Press, Los Alamitos (2003)Google Scholar
  12. 12.
    Meyer, A.R., Wand, M.: Continuation semantics in typed lambdacalculi (summary). In: Parikh, R. (ed.) Logic of Programs 1985. LNCS, vol. 193, pp. 219–224. Springer, Heidelberg (1985)Google Scholar
  13. 13.
    Moggi, E.: Computational lambda calculus and monads. In: Proceedings, Fourth Annual Symposium on Logic in Computer Science, pp. 14–23 (1989)Google Scholar
  14. 14.
    O’Hearn, P.W., Reynolds, J.C.: From Algol to polymorphic linear lambda-calculus. Journal of the ACM 47, 167–223 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Pitts, A.M.: Parametric polymorphism and operational equivalence. Mathematical Structures in Computer Science 10, 321–359 (2000)zbMATHCrossRefMathSciNetGoogle Scholar
  16. 16.
    Plotkin, G.D.: Call-by-name, call-by-value, and the λ-calculus. Theoretical Computer Science 1(2), 125–159 (1975)zbMATHCrossRefMathSciNetGoogle Scholar
  17. 17.
    Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Mason, R.E.A. (ed.) Information Processing 1983, pp. 513–523. Elsevier Science Publishers B. V., North-Holland, Amsterdam (1983)Google Scholar
  18. 18.
    Streicher, T., Reus, B.: Classical logic: Continuation semantics and abstract machines. Journal of Functional Programming 8(6) (1998)Google Scholar
  19. 19.
    Thielecke, H.: Comparing control constructs by double-barrelled CPS. Higherorder and Symbolic Computation 15(2/3), 141–160 (2002)zbMATHCrossRefGoogle Scholar
  20. 20.
    Thielecke, H.: From control effects to typed continuation passing. In: 30th SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL 2003), pp. 139–149. ACM, New York (2003)CrossRefGoogle Scholar
  21. 21.
    Wadler, P.: Theorems for free! In: 4’th International Conference on Functional Programming and Computer Architecture (FPCA 1989), pp. 347–359. ACM, New York (1989)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Hayo Thielecke
    • 1
  1. 1.School of Computer ScienceUniversity of BirminghamBirminghamUnited Kingdom

Personalised recommendations