LFP '90 Proceedings of the 1990 ACM conference on LISP and functional programming
POPL '94 Proceedings of the 21st ACM SIGPLAN-SIGACT symposium on Principles of programming languages
ESOP'92 Selected papers of the symposium on Fourth European symposium on programming
From control effects to typed continuation passing
POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Continuations: A Mathematical Semantics for Handling FullJumps
Higher-Order and Symbolic Computation
On the Transformation between Direct and Continuation Semantics
Proceedings of the 9th International Conference on Mathematical Foundations of Programming Semantics
Rabbit: A Compiler for Scheme
A sound and complete axiomatization of delimited continuations
ICFP '03 Proceedings of the eighth ACM SIGPLAN international conference on Functional programming
Journal of Functional Programming
Journal of Functional Programming
Polymorphic delimited continuations
APLAS'07 Proceedings of the 5th Asian conference on Programming languages and systems
Direct implementation of shift and reset in the MinCaml compiler
Proceedings of the 2009 ACM SIGPLAN workshop on ML
Polymorphic delimited continuations
APLAS'07 Proceedings of the 5th Asian conference on Programming languages and systems
Functional derivation of a virtual machine for delimited continuations
Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
Invertible syntax descriptions: unifying parsing and pretty printing
Proceedings of the third ACM Haskell symposium on Haskell
Shifting the stage: Staging with delimited control
Journal of Functional Programming
FLOPS'12 Proceedings of the 11th international conference on Functional and Logic Programming
Typed tagless final interpreters
SSGIP'10 Proceedings of the 2010 international spring school conference on Generic and Indexed Programming
Higher-Order and Symbolic Computation
Hi-index | 0.00 |
In "Functional Unparsing" (J. Funct. Program. 8(6):621---625, 1998), Danvy presented a type-safe printf function using continuations and an accumulator to achieve the effect of dependent types. The key technique employed in Danvy's solution is the non-standard use of continuations: not all of its calls are tail calls, i.e., it uses delimited continuations. Against this backdrop, we present three new solutions to the printf problem: a simpler one that also uses delimited continuations but that does not use an accumulator, and the corresponding two in direct style with the delimited-control operators, shift and reset. These two solutions are the direct-style counterparts of the two continuation-based ones. The last solution pinpoints the essence of Danvy's solution: shift is used to change the answer type of delimited continuations. Besides providing a new application of shift and reset, the solutions in direct style raise a key issue in the typing of first-class delimited continuations and require Danvy and Filinski's original type system. The resulting types precisely account for the behavior of printf.