Cont package:rebase

Continuation monad. Cont r a is a CPS ("continuation-passing style") computation that produces an intermediate result of type a within a CPS computation whose final result type is r. The return function simply creates a continuation which passes the value on. The >>= operator adds the bound function into the continuation chain.
Construct a continuation-passing computation from a function. (The inverse of runCont)
The continuation monad transformer. Can be used to add continuation handling to any type constructor: the Monad instance and most of the operations do not require m to be a monad. ContT is not a functor on the category of monads, and many operations cannot be lifted through it.
The class of contravariant functors. Whereas in Haskell, one can think of a Functor as containing or producing values, a contravariant functor is a functor that can be thought of as consuming values. As an example, consider the type of predicate functions a -> Bool. One such predicate might be negative x = x < 0, which classifies integers as to whether they are negative. However, given this predicate, we can re-use it in other situations, providing we have a way to map values to integers. For instance, we can use the negative predicate on a person's bank balance to work out if they are currently overdrawn:
newtype Predicate a = Predicate { getPredicate :: a -> Bool }

instance Contravariant Predicate where
contramap :: (a' -> a) -> (Predicate a -> Predicate a')
contramap f (Predicate p) = Predicate (p . f)
|   `- First, map the input...
`----- then apply the predicate.

overdrawn :: Predicate Person
overdrawn = contramap personBankBalance negative
Any instance should be subject to the following laws: Note, that the second law follows from the free theorem of the type of contramap and the first law, so you need only check that the former condition holds.
Cc: Other, Control
Wrap a Contravariant functor to be used as a member of Invariant.
The result of running a CPS computation with the identity as the final continuation.
The result of running a CPS computation with return as the final continuation.
Return a lazy list representing the contents of the supplied Chan, much like hGetContents.
The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).
Every Contravariant functor is also an Invariant functor.
Selects control characters, which are the non-printing characters of the Latin-1 subset of Unicode.
Apply a function to transform the result of a continuation-passing computation.
The result of running a CPS computation with a given final continuation. (The inverse of cont)
Apply a function to transform the continuation passed to a CPS computation.