Skip to main content Accessibility help
×
Home

A monadic framework for delimited continuations

  • R. KENT Dyvbig (a1), SIMON PEYTON JONES (a2) and AMR SABRY (a1)

Abstract

Delimited continuations are more expressive than traditional abortive continuations and they apparently require a framework beyond traditional continuation-passing style (CPS). We show that this is not the case: standard CPS is sufficient to explain the common control operators for delimited continuations. We demonstrate this fact and present an implementation as a Scheme library. We then investigate a typed account of delimited continuations that makes explicit where control effects can occur. This results in a monadic framework for typed and encapsulated delimited continuations, which we design and implement as a Haskell library.

Copyright

References

Hide All
Ariola, Z. M., Herbelin, H. and Sabry, A. (2004) A type-theoretic foundation of continuations and prompts. Pages 40–53 of ACM SIGPLAN International Conference on Functional Programming. ACM Press, New York.
Biernacki, D. and Danvy, O. (2006) A simple proof of a folklore theorem about delimited control. J. Funct. Program, 16, 269280.
Cheney, J. and Hinze, R. (2002) A lightweight implementation of generics and dynamics. Pages 90–104 of: Proceedings of the ACM SIGPLAN Workshop on Haskell. New York: ACM Press.
Danvy, O. and Filinski, A. (1989) A functional abstraction of typed contexts. Tech. rept. 89/12. DIKU, University of Copenhagen, Copenhagen, Denmark.
Danvy, O. and Filinski, A. (1990) Abstracting control. Pages 151–160 of: Proceedings of the 1990 ACM Conference on LISP and Functional Programming. New York: ACM Press.
Dybvig, R. K. and Hieb, R. (1989) Engines from continuations. Computer Languages, 14 (2), 109123.
Felleisen, M., Friedman, D. P., Kohlbecker, E. and Duba, B. (1987a) A syntactic theory of sequential control. Theor. Comput. Sci. 52 (3), 205237.
Felleisen, M. (1988) The theory and practice of first-class prompts. Pages 180–190 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. New York: ACM Press.
Felleisen, M. and Friedman, D. P. (1987) A reduction semantics for imperative higher-order languages. Parallel Architectures and Languages Europe, 259, 206223.
Felleisen, M., Friedman, D. P., Duba, B. and Merrill, J.. (1987b) Beyond continuations. Tech. rept. 216. Indiana University Computer Science Department.
Felleisen, M., Wand, M., Friedman, D. P. and Duba, B. F. (1988) Abstract continuations: A mathematical semantics for handling full functional jumps. Pages 52–62 of: Proceedings of the ACM Conference on Lisp and Functional Programming. New York: ACM Press.
Filinski, A. (1994) Representing monads. Pages 446–457 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. New York: ACM Press.
Filinski, A. (1996) Controlling effects. PhD thesis, School of Computer Science, Carnegie Mellon University. Technical Report CMU-CS-96-119.
Filinski, A. (1999) Representing layered monads. Pages 175–188 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. New York: ACM Press.
Findler, R. B., Latendresse, M. and Felleisen, M. (2001) Behavioral contracts and behavioral subtyping. Pages 229–236 of: ESEC/FSE-9: Proceedings of the 8th European Software Engineering Conference. New York, NY: ACM Press.
Friedman, D. P. and Kiselyov, O. (2005) A declarative applicative logic programming system. Available from: http://kanren.sourceforge.net/.
Gasbichler, M. and Sperber, M. (2002) Final shift for call/cc: direct implementation of shift and reset. Pages 271–282 of: ACM SIGPLAN International Conference on Functional Programming. ACM Press.
Gunter, C. A.Rémy, D. and Riecke, J. G. (1995) A generalization of exceptions and control in ML-like languages. Functional Programming & Computer Architecture. New York: ACM Press.
Harper, R., Duba, B. F. and MacQueen, D. (1993) Typing first-class continuations in ML. J. Funct. Program. 3 (4), 465484.
Hatcliff, J. and Danvy, O. (1994) A generic account of continuation-passing styles. Pages 458–471 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. New York: ACM Press.
Hieb, R. and Dybvig, R. K. (1990) Continuations and Concurrency. Pages 128–136 of: Symposium on Principles and Practice of Parallel Programming. SIGPLAN Notices, vol. 25 (3).
Hieb, R., Dybvig, R.K. and Bruggeman, C. (1990) Representing control in the presence of first-class continuations. Pages 66–77 of: Proceedings of the SIGPLAN '90 Conference on Programming Language Design and Implementation.
Hieb, R., Dybvig, R. K. and Anderson, III, C. W. (1994) Subcontinuations. Lisp and Symbolic Computation, 7 (1), 83110.
Hinze, R. (2000) Deriving backtracking monad transformers. Pages 186–197 of: ICFP '00: Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming. ACM Press.
Huet, G. (1997) The zipper. J. Funct. Program. 7 (5), 549554.
Kiselyov, O. (2005) How to remove a dynamic prompt: static and dynamic delimited continuation operators are equally expressible. Tech. rept. TR611. Indiana University.
Kiselyov, O., Chung-chieh, Shan, Friedman, D. P. and Sabry, A. (2005) Backtracking, interleaving, and terminating monad transformers Functional Pearl. ACM SIGPLAN International Conference on Functional Programming. ACM Press, New York.
Launchbury, J. and Peyton Jones, S. L. (1995) State in Haskell. Lisp and Symbolic Computation, 8 (4), 293341.
Moggi, E. (1991) Notions of computation and monads. Infor. & Comput. 93 (1), 5592.
Moreau, L. and Queinnec, C. (1994) Partial continuations as the difference of continuations. A duumvirate of control operators. Lecture Notes in Computer Science, 844.
Murthy, C. (1992) Control operators, hierarchies, and pseudo-classical type systems: A-translation at work. Pages 49–71 of: ACM Workshop on Continuations.
Nanevski, A. (2004) A modal calculus for named control effects. Unpublished manuscript.
Pottier, F. and Régis-Gianas, Y. (2006) Stratified type inference for generalised algebraic data types. Pages 232–244 of: 33rd ACM Symposium on Principles of Programming Languages (POPL'06). ACM.
Queinnec, C. and Serpette, B. (1991) A dynamic extent control operator for partial continuations. Pages 174–184 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. New York: ACM Press.
Chung-chieh, Shan (2004) Shift to control. Pages 99–107 of: Shivers, O. and Waddell, O. (editors), Proceedings of the 5th Workshop on Scheme and Functional Programming. Technical report, Computer Science Department, Indiana University, 2004.
Sitaram, D. and Felleisen, M. (1990a) Control delimiters and their hierarchies. Lisp & Symbolic Computation, 3 (1), 6799.
Sitaram, D. and Felleisen, M. (1990b) Reasoning with continuations II: full abstraction for models of control. Pages 161–175 of: LFP '90: Proceedings of the 1990 ACM Conference on Lisp and Functional Programming. New York, NY, USA: ACM Press.
Sitaram, D. and Felleisen, M. (1991) Models of continuations without continuations. Pages 185–196 of: POPL '91: Proceedings of the 18th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. New York, NY, USA: ACM Press.
Strachey, C. and Wadsworth, C. P. (1974) Continuations A mathematical semantics for handling full jumps. Technical Monograph PRG-11. Oxford University Computing Laboratory Programming Research Group.
Tang, A. (2005) Pugs: Boolstrapping Perl 6 with Haskell. Available from http://perlcabal.org/~autrijus/hw2005.pdf.
Thielecke, H. (2003) From control effects to typed continuation passing. Pages 139–149 of: Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. ACM SIGPLAN Notices, vol. 38, 1.
Wadler, P. (1994) Monads and composable continuations. Lisp & Symbolic Computation, 7 (1), 3956.
Wadler, P. (1998) The marriage of effects and monads. Pages 63–74 of: ACM SIGPLAN International Conference on Functional Programming. ACM Press.
Xi, H., Chen, C. and Chen, G. (2003) Guarded recursive datatype constructors. Pages 224–235 of: Norris, C. and Fenwick, Jr., J. B. (editors), Conference Record of the ACM SIGPLAN-SIGACT Symposium on the Principles of Programming Languages. ACM SIGPLAN Notices, vol. 38, 1.

Related content

Powered by UNSILO

A monadic framework for delimited continuations

  • R. KENT Dyvbig (a1), SIMON PEYTON JONES (a2) and AMR SABRY (a1)

Metrics

Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed.

A monadic framework for delimited continuations

  • R. KENT Dyvbig (a1), SIMON PEYTON JONES (a2) and AMR SABRY (a1)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *