[Haskell-cafe] ANNOUNCE: CC-delcont-0.1;
Delimited continuations for Haskell
dan.doel at gmail.com
Sun Jul 15 06:41:56 EDT 2007
After a bit of hacking, and much documenting, I'm pleased to announce a
preliminary release of a delimited continuation library for Haskell.
The implementation is drawn from "A Monadic Framework for Delimited
Continuations" by Dybvig, Petyon Jones and Sabry, although it has some
abstraction available over said implementation (there is both a monad and a
transformer; control operations will work interchangeably with either. In
addition, all four control operators from "Shift to Control" are
In addition, I have done the adaptation necessary to include the Haskell
implementation of the dynamic scoping investigated in "Delimited Dynamic
Binding" by Kiselyov, Shan and Sabry, and it has been included. One can
think of it as embeddings of the reader or state monads into the delimited
control monads (only more flexible).
In the future, I'd like to also, possibly, include something like Oleg's
generic zippers, and possibly other useful abstractions based on delimited
continuations, if I find them. But that's work for another day, I suppose.
If you wish to try it out, a package is available on hackage:
However, I should warn that it's fairly dependent on GHC HEAD at the moment:
1) It uses the Unsafe.Coerce module
2) It uses GADTs to store type class evidence
3) It uses GHC-features that haddock will choke on, so haddock.ghc will be
required for docs (and I haven't gotten that working yet to check that the
haddock is bug-free), which in turn requires GHC HEAD.
1 & 2 could be relaxed if there's interest.
Please feel free to let me know if you find any bugs, or have any suggestions
I'll follow up this message with a message containing an example program and a
More information about the Haskell-Cafe