{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,2,5]],"date-time":"2026-02-05T12:44:34Z","timestamp":1770295474841,"version":"3.49.0"},"reference-count":19,"publisher":"Association for Computing Machinery (ACM)","issue":"ICFP","license":[{"start":{"date-parts":[[2018,7,30]],"date-time":"2018-07-30T00:00:00Z","timestamp":1532908800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/100000001","name":"NSF","doi-asserted-by":"publisher","award":["1122374"],"award-info":[{"award-number":["1122374"]}],"id":[{"id":"10.13039\/100000001","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Proc. ACM Program. Lang."],"published-print":{"date-parts":[[2018,7,30]]},"abstract":"<jats:p>Delimited continuations are the mother of all monads! So goes the slogan inspired by Filinski\u2019s 1994 paper, which showed that delimited continuations can implement any monadic effect, letting the programmer use an effect as easily as if it was built into the language. It\u2019s a shame that not many languages have delimited continuations.<\/jats:p>\n          <jats:p>\n            Luckily, exceptions and state are also the mother of all monads! In this Pearl, we show how to implement delimited continuations in terms of exceptions and state, a construction we call\n            <jats:italic>thermometer continuations<\/jats:italic>\n            . While traditional implementations of delimited continuations require some way of \u201dcapturing\u201d an intermediate state of the computation, the insight of thermometer continuations is to reach this intermediate state by replaying the entire computation from the start, guiding it using a recording so that the same thing happens until the captured point.\n          <\/jats:p>\n          <jats:p>Along the way, we explain delimited continuations and monadic reflection, show how the Filinski construction lets thermometer continuations express any monadic effect, share an elegant special-case for nondeterminism, and discuss why our construction is not prevented by theoretical results that exceptions and state cannot macro-express continuations.<\/jats:p>","DOI":"10.1145\/3236771","type":"journal-article","created":{"date-parts":[[2018,7,31]],"date-time":"2018-07-31T19:41:18Z","timestamp":1533066078000},"page":"1-29","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":2,"title":["Capturing the future by replaying the past (functional pearl)"],"prefix":"10.1145","volume":"2","author":[{"given":"James","family":"Koppel","sequence":"first","affiliation":[{"name":"Massachusetts Institute of Technology, USA"}]},{"given":"Gabriel","family":"Scherer","sequence":"additional","affiliation":[{"name":"Inria, France"}]},{"given":"Armando","family":"Solar-Lezama","sequence":"additional","affiliation":[{"name":"Massachusetts Institute of Technology, USA"}]}],"member":"320","published-online":{"date-parts":[[2018,7,30]]},"reference":[{"key":"e_1_2_2_1_1","unstructured":"Kenichi Asai and Oleg Kiselyov. 2011. Introduction to Programming with Shift and Reset. (2011). http:\/\/pllab.is.ocha.ac.jp\/ ~asai\/cw2011tutorial\/main- e.pdf  Kenichi Asai and Oleg Kiselyov. 2011. Introduction to Programming with Shift and Reset. (2011). http:\/\/pllab.is.ocha.ac.jp\/ ~asai\/cw2011tutorial\/main- e.pdf"},{"key":"e_1_2_2_2_1","unstructured":"Alberto Gomez Corona. 2014. MFlow a Continuation-Based Web Framework Without Continuations. (2014). https: \/\/themonadreader.files.wordpress.com\/2014\/04\/mflow.pdf  Alberto Gomez Corona. 2014. MFlow a Continuation-Based Web Framework Without Continuations. (2014). https: \/\/themonadreader.files.wordpress.com\/2014\/04\/mflow.pdf"},{"key":"e_1_2_2_3_1","volume-title":"The Mother of all Monads","author":"Piponi Dan","unstructured":"Dan Piponi . 2008. The Mother of all Monads . http:\/\/blog.sigfpe.com\/2008\/12\/mother- of- all- monads.html . (2008). Posted: 2008-12-24. Accessed: 2017-02-27. Dan Piponi. 2008. The Mother of all Monads. http:\/\/blog.sigfpe.com\/2008\/12\/mother- of- all- monads.html . (2008). Posted: 2008-12-24. Accessed: 2017-02-27."},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3110256"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1017\/S0956796807006259"},{"key":"e_1_2_2_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/73560.73576"},{"key":"e_1_2_2_7_1","doi-asserted-by":"crossref","unstructured":"Matthias Felleisen. 1990. On the Expressive Power of Programming Languages. (1990) 134\u2013151.   Matthias Felleisen. 1990. On the Expressive Power of Programming Languages. (1990) 134\u2013151.","DOI":"10.1007\/3-540-52592-0_60"},{"key":"e_1_2_2_8_1","doi-asserted-by":"publisher","DOI":"10.1145\/174675.178047"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/292540.292557"},{"key":"e_1_2_2_10_1","first-page":"95","article-title":"Curry: A Truly Functional Logic Language","volume":"95","author":"Hanus Michael","year":"1995","unstructured":"Michael Hanus , Herbert Kuchen , and Juan Jose Moreno-Navarro . 1995 . Curry: A Truly Functional Logic Language . In Proc. ILPS , Vol. 95. 95 \u2013 107 . Michael Hanus, Herbert Kuchen, and Juan Jose Moreno-Navarro. 1995. Curry: A Truly Functional Logic Language. In Proc. ILPS, Vol. 95. 95\u2013107.","journal-title":"Proc. ILPS"},{"key":"e_1_2_2_11_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-31113-0_16"},{"key":"e_1_2_2_12_1","doi-asserted-by":"publisher","DOI":"10.1007\/978-3-642-12251-4_22"},{"key":"e_1_2_2_13_1","volume-title":"Post-proceedings of the ML workshop","author":"Kiselyov Oleg","year":"2017","unstructured":"Oleg Kiselyov and KC Sivaramakrishnan . 2017 . Eff directly in OCaml . In Post-proceedings of the ML workshop 2016. http:\/\/kcsrk.info\/papers\/caml- eff17.pdf Oleg Kiselyov and KC Sivaramakrishnan. 2017. Eff directly in OCaml. In Post-proceedings of the ML workshop 2016. http:\/\/kcsrk.info\/papers\/caml- eff17.pdf"},{"key":"e_1_2_2_14_1","volume-title":"Capturing the Future by Replaying the Past. CoRR abs\/1710.10385","author":"Koppel James","year":"2017","unstructured":"James Koppel , Gabriel Scherer , and Armando Solar-Lezama . 2017. Capturing the Future by Replaying the Past. CoRR abs\/1710.10385 ( 2017 ). arXiv: 1710.10385 http:\/\/arxiv.org\/abs\/1710.10385 James Koppel, Gabriel Scherer, and Armando Solar-Lezama. 2017. Capturing the Future by Replaying the Past. CoRR abs\/1710.10385 (2017). arXiv: 1710.10385 http:\/\/arxiv.org\/abs\/1710.10385"},{"key":"e_1_2_2_15_1","doi-asserted-by":"publisher","DOI":"10.1023\/A:1010020917337"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/1086365.1086393"},{"key":"e_1_2_2_17_1","volume-title":"Contrasting Exceptions and Continuations. Version available from http:\/\/www. cs. bham. ac. uk\/hxt\/research\/exncontjournal. pdf","author":"Thielecke Hayo","year":"2001","unstructured":"Hayo Thielecke . 2001. Contrasting Exceptions and Continuations. Version available from http:\/\/www. cs. bham. ac. uk\/hxt\/research\/exncontjournal. pdf ( 2001 ). Hayo Thielecke. 2001. Contrasting Exceptions and Continuations. Version available from http:\/\/www. cs. bham. ac. uk\/hxt\/research\/exncontjournal. pdf (2001)."},{"key":"e_1_2_2_18_1","doi-asserted-by":"publisher","DOI":"10.1007\/11737414_19"},{"key":"e_1_2_2_19_1","volume-title":"TIOBE Index for","author":"TIOBE","year":"2017","unstructured":"TIOBE Software BV. 2017. TIOBE Index for February 2017 . http:\/\/www.tiobe.com\/tiobe- index\/ . (2017). Posted: 2017-02-08. Accessed : 2017-02-22. TIOBE Software BV. 2017. TIOBE Index for February 2017. http:\/\/www.tiobe.com\/tiobe- index\/ . (2017). Posted: 2017-02-08. Accessed: 2017-02-22."}],"container-title":["Proceedings of the ACM on Programming Languages"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236771","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3236771","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3236771","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,18]],"date-time":"2025-06-18T21:41:28Z","timestamp":1750282888000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3236771"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2018,7,30]]},"references-count":19,"journal-issue":{"issue":"ICFP","published-print":{"date-parts":[[2018,7,30]]}},"alternative-id":["10.1145\/3236771"],"URL":"https:\/\/doi.org\/10.1145\/3236771","relation":{},"ISSN":["2475-1421"],"issn-type":[{"value":"2475-1421","type":"electronic"}],"subject":[],"published":{"date-parts":[[2018,7,30]]},"assertion":[{"value":"2018-07-30","order":2,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}