
bob zhang
I was curious that we could bring really continuations into haskell, the traditional callCC brings a lot of unnecessary type restrictions
That's where the misconception lies. The type parameter /is/ necessary for delimited continuations in Haskell. By the way, I don't see how these continuations would be in any way not "real" or how the type parameter places any "restrictions", unless of course you want dynamic typing. The only operations I can imagine, which really restrict the type parameter, are the operation of aborting the entire computation and manipulating the result of it: abort :: a -> ContT a m a mapContT :: (r -> r) -> ContT r m () You can have undelimited CPS without the type parameter, but then you won't get any CPS effects. As noted, you will just have an IdentityT-like monad transformer, which can at best improve the semantics of the underlying monad. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife >>= sex) http://ertes.de/