Safe Haskell  None 

 type Chronicle c = ChronicleT c Identity
 chronicle :: These c a > Chronicle c a
 runChronicle :: Chronicle c a > These c a
 newtype ChronicleT c m a = ChronicleT {
 runChronicleT :: m (These c a)
 dictate :: (Monoid c, Monad m) => c > ChronicleT c m ()
 confess :: (Monoid c, Monad m) => c > ChronicleT c m a
 memento :: (Monoid c, Monad m) => ChronicleT c m a > ChronicleT c m (Either c a)
 absolve :: (Monoid c, Monad m) => a > ChronicleT c m a > ChronicleT c m a
 condemn :: (Monoid c, Monad m) => ChronicleT c m a > ChronicleT c m a
 retcon :: (Monoid c, Monad m) => (c > c) > ChronicleT c m a > ChronicleT c m a
 module Data.Semigroup
 module Data.Monoid
 module Control.Monad
 module Control.Monad.Trans
The Chronicle monad
type Chronicle c = ChronicleT c IdentitySource
runChronicle :: Chronicle c a > These c aSource
The ChronicleT monad transformer
newtype ChronicleT c m a Source
The ChronicleT
monad transformer.
The return
function produces a computation with no output, and >>=
combines multiple outputs with mappend
.
ChronicleT  

Chronicle operations
dictate :: (Monoid c, Monad m) => c > ChronicleT c m ()Source
confess :: (Monoid c, Monad m) => c > ChronicleT c m aSource
is an action that ends with a final output confess
cc
.
Equivalent to throwError
for the Error
monad.
memento :: (Monoid c, Monad m) => ChronicleT c m a > ChronicleT c m (Either c a)Source
is an action that executes the action memento
mm
, returning either
its record if it ended with confess
, or its final value otherwise, with
any record added to the current record.
Similar to catchError
in the Error
monad, but with a notion of
nonfatal errors (which are accumulated) vs. fatal errors (which are caught
without accumulating).
absolve :: (Monoid c, Monad m) => a > ChronicleT c m a > ChronicleT c m aSource
condemn :: (Monoid c, Monad m) => ChronicleT c m a > ChronicleT c m aSource
is an action that executes the action condemn
mm
and keeps its value
only if it had no record. Otherwise, the value (if any) will be discarded
and only the record kept.
This can be seen as converting nonfatal errors into fatal ones.
retcon :: (Monoid c, Monad m) => (c > c) > ChronicleT c m a > ChronicleT c m aSource
module Data.Semigroup
module Data.Monoid
module Control.Monad
module Control.Monad.Trans