Advertisement

Typed Dynamic Control Operators for Delimited Continuations

  • Yukiyoshi Kameyama
  • Takuo Yonezawa
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4989)

Abstract

We study the dynamic control operators for delimited continuations, Control and Prompt. Based on recent developments on purely functional CPS translations for them, we introduce a polymorphically typed calculus for these control operators which allows answer-type modification. We show that our calculus enjoys type soundness and is compatible with the CPS translation. We also show that the typed dynamic control operators can macro-express the typed static ones (Shift and Reset), while the converse direction is not possible, which exhibits a sharp contrast with the type-free case.

Keywords

Type System Delimited Continuation Dynamic Control Operator CPS Translation Polymorphism Expressivity 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Asai, K.: On Typing Delimited Continuations: Three New Solutions to the Printf Problem. Technical Report OCHA-IS 07-1, Department of Information Science, Ochanomizu University (September, 2007)Google Scholar
  2. 2.
    Asai, K., Kameyama, Y.: Polymorphic Delimited Continuations. In: Shao, Z. (ed.) APLAS 2007. LNCS, vol. 4807, pp. 239–254. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  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.
    Biernacki, D., Danvy, O.: A Simple Proof of a Folklore Theorem about Delimited Control. J. Funct. Program. 16(3), 269–280 (2006)zbMATHCrossRefMathSciNetGoogle Scholar
  5. 5.
    Biernacki, D., Danvy, O., Shan, C.-c.: On the Static and Dynamic Extents of Delimited Continuations. Science of Computer Programming 60(3), 274–297 (2006)zbMATHCrossRefMathSciNetGoogle Scholar
  6. 6.
    Biernacki, D., Danvy, O., Millikin, K.: A Dynamic Continuation-Passing Style for Dynamic Delimited Continuations. TOPLAS (to appear)Google Scholar
  7. 7.
    Shan, C.-c.: Shift to control. In: Proc. Workshop on Scheme and Functional Programming, pp. 99–107 (2004)Google Scholar
  8. 8.
    Danvy, O.: Functional Unparsing. J. Funct. Program. 8(6), 621–625 (1998)zbMATHCrossRefGoogle Scholar
  9. 9.
    Danvy, O., Filinski, A.: Abstracting Control. In: Proc. 1990 ACM Conference on Lisp and Functional Programming, pp. 151–160 (1990)Google Scholar
  10. 10.
    Danvy, O., Filinski, A.: Representing Control: A Study of the CPS Transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)zbMATHMathSciNetCrossRefGoogle Scholar
  11. 11.
    Dybvig, R.K., Peyton Jones, S., Sabry, A.: A Monadic Framework for Delimited Continuations. J. Funct. Program (to appear)Google Scholar
  12. 12.
    Felleisen, M.: The Theory and Practice of First-Class Prompts. In: Proc. 15th Symposium on Principles of Programming Languages, pp. 180–190 (1988)Google Scholar
  13. 13.
    Filinski, A.: Representing Monads. In: POPL, pp. 446–457 (1994)Google Scholar
  14. 14.
    Kameyama, Y., Hasegawa, M.: A sound and complete axiomatization for delimited continuations. In: ICFP, pp. 177–188 (2003)Google Scholar
  15. 15.
    Kiselyov, O.: How to remove dynamic prompt: Static and dynamic delimited continuation operators are equally expressive. Technical Report 611, Computer Science Department, Indiana University (March, 2005)Google Scholar
  16. 16.
    Kiselyov, O.: Fixpoint combinator from typed prompt/control (2007), http://okmij.org/ftp/Computation/Continuations.html
  17. 17.
    Lillibridge, M.: Unchecked Exceptions Can Be Strictly More Powerful Than Call/CC. Higher-Order and Symbolic Computation 12(1), 75–104 (1999)zbMATHCrossRefGoogle Scholar
  18. 18.
    Strachey, C., Wadsworth, C.P.: Continuations: A mathematical semantics for handling full jumps. Technical Monograph PRG-11, Oxford Univ. Comput. Lab., Oxford, England, 1974. Reprinted in Higher-Order and Symbolic Computation 13(1/2), pp. 135–152 (2000)Google Scholar
  19. 19.
    H. Thielecke. On Exceptions Versus Continuations in the Presence of State. In ESOP, pages 397–411, 2000.CrossRefGoogle Scholar
  20. 20.
    Yonezawa, T., Kameyama, Y.: A Type System for Dynamic Delimited Continuations. In: IPSJ Transactions on Programming, Information Processing Society of Japan (to appear)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Yukiyoshi Kameyama
    • 1
  • Takuo Yonezawa
    • 1
  1. 1.Department of Computer ScienceUniversity of Tsukuba 

Personalised recommendations