Continuations are interesting. Especially interesting is how they encompass all other monads. Also, I hear they are used a lot for optimizing. One thing I hear they could be used for is inversion of control in things. Like, gui's and stuff. I am wondering if there is an example of a library in Haskell that uses this.
I'm not particularly interested in it being popular or anything. I mainly want it for reading. Factors to consider:
- Straight continuations, not continuation derivatives: It should be based on a type similar to
newtype Cont r a = Cont ((a -> r) -> r)
. (Combinators are okay, but it should be understandable how straight continuations are fitting into it.) - Used for inversion of control: Continuations are used for many uses, but I'm interested mostly in GUI type things or other places where inversion of control makes things easier
- Prevalence: Continuations should be the prevalent control structure.
- Well written: Code should be easier to read and learn from.
(The reason why I want to do this is I find Continuations, being based only on functions, to be a very pure functional programming concept, while being very powerful. There is this one library I like that is very straight functional programming, and I would love to extend it with continuations.)
Note: Being straight continuations isn't very important. Inversion of Control is what I'm mostly after.