Delimited Continuations for Everyone
summary
Delimited continuations implemented with shift/reset are used to do concrete tasks: early-returning a list product by discarding continuation to avoid extra multiplications, extracting a continuation to produce a curried append, reordering stack-like consing to implement move-to-front and A-normalization via let-insertion (used in “cogen in six lines”), and wrapping continuations to implement a typed printf and encode the state monad (Filinski’s representation). An OchaCaml implementation and example code exist and the six worked examples are shown end-to-end.
AI-written summary · about
chapters (17)
- 0:00Introduction and motivation
- 1:18Early papers on control operators
- 2:02What are continuations
- 6:04Delimited continuations explained
- 8:06Shift operator basics
- 9:18Discarding continuations
- 12:10Multiplying list elements with shift
- 14:49Extracting continuations
- 16:26Identity function on lists
- 18:54Reordering continuations
- 26:49A-normalization with shift/reset
- 33:41Wrapping continuations
- 36:03Typed printf example
- 39:13State monad with shift/reset
- 43:01Future of shift/reset in theorem proving
- 49:09Type system and logic
- 50:20Why shift/reset matters
