MonadCont, the Continuation Monad, is used to handle callback hell among other things.

           -- r      m     a
newtype ContT return monad input =
  ContT ((input -> monad return) -> monad return)

-- Pseudo-Syntax: combine class and instance into one block
-- and "n" represents ContT:
class (Monad m) <= MonadCont r (ContT r m) where
  callCC :: forall a. (forall b. (a -> n b) -> n a) -> n   a
  callCC :: forall a. (forall b. ContT b m a)       -> ContT r m a

Derived Functions


Laws, Instances, and Miscellaneous Functions

There aren't any laws!


To handle/modify the output of a continuation computation: