Functional pearl

David Herman
2007 SIGPLAN notices  
Filinski showed that callcc and a single mutable reference cell are sufficient to express the delimited control operators shift and reset. However, this implementation interacts poorly with dynamic bindings like exception handlers. We present a variation on Filinski's encoding of delimited continuations that behaves appropriately in the presence of exceptions and give an implementation in Standard ML of New Jersey. We prove the encoding correct with respect to the semantics of delimited dynamic
more » ... f delimited dynamic binding.
doi:10.1145/1291220.1291177 fatcat:mteys6hub5dx3dlwt53gm42fty