Show simple item record

dc.contributor.authorScherer, Gabriel
dc.contributor.authorKoppel, James Brandon
dc.contributor.authorSolar Lezama, Armando
dc.date.accessioned2018-08-16T15:26:52Z
dc.date.available2018-08-16T15:26:52Z
dc.date.issued2018-07
dc.identifier.issn2475-1421
dc.identifier.urihttp://hdl.handle.net/1721.1/117385
dc.description.abstractDelimited continuations are the mother of all monads! So goes the slogan inspired by Filinski’s 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’s a shame that not many languages have delimited continuations. 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 thermometer continuations. While traditional implementations of delimited continuations require some way of ”capturing” 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. 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.en_US
dc.description.sponsorshipNational Science Foundation (U.S.) (Grant 1122374)en_US
dc.language.isoen_US
dc.publisherAssociation for Computing Machinery (ACM)en_US
dc.relation.isversionofhttp://dx.doi.org/10.1145/3236771en_US
dc.rightsCreative Commons Attribution 4.0 International Licenseen_US
dc.rights.urihttp://creativecommons.org/licenses/by/4.0/en_US
dc.sourceProf. Solar-Lezamaen_US
dc.titleCapturing the future by replaying the past (functional pearl)en_US
dc.typeArticleen_US
dc.identifier.citationKoppel, James et al. “Capturing the Future by Replaying the Past (functional Pearl).” Proceedings of the ACM on Programming Languages 2, ICFP (July 2018): 1–29 © 2018 The Authorsen_US
dc.contributor.departmentMassachusetts Institute of Technology. Department of Electrical Engineering and Computer Scienceen_US
dc.contributor.approverSolar-Lezama, Armandoen_US
dc.contributor.mitauthorKoppel, James Brandon
dc.contributor.mitauthorSolar Lezama, Armando
dc.relation.journalProceedings of the ACM on Programming Languagesen_US
dc.eprint.versionFinal published versionen_US
dc.type.urihttp://purl.org/eprint/type/JournalArticleen_US
eprint.statushttp://purl.org/eprint/status/PeerRevieweden_US
dspace.orderedauthorsKoppel, James; Scherer, Gabriel; Solar-Lezama, Armandoen_US
dspace.embargo.termsNen_US
dc.identifier.orcidhttps://orcid.org/0000-0002-3948-6904
dc.identifier.orcidhttps://orcid.org/0000-0001-7604-8252
mit.licensePUBLISHER_CCen_US


Files in this item

Thumbnail

This item appears in the following Collection(s)

Show simple item record