Safe Haskell  None 

 class Monad m => MonadChronicle c m  m > c where
 type Chronicle c = ChronicleT c Identity
 runChronicle :: Chronicle c a > These c a
 newtype ChronicleT c m a = ChronicleT {
 runChronicleT :: m (These c a)
 module Data.Monoid
 module Control.Monad
 module Control.Monad.Trans
Type class for Chroniclestyle monads
class Monad m => MonadChronicle c m  m > c whereSource
is an action that ends with a final output confess
cc
.
Equivalent to throwError
for the Error
monad.
memento :: m a > 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 :: a > m a > m aSource
is an action that executes the action absolve
x mm
and discards any
record it had. The default value x
will be used if m
ended via
confess
.
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 :: (c > c) > m a > m aSource
is an action that executes the action retcon
f mm
and applies the
function f
to its output, leaving the return value unchanged.
chronicle :: These c a > m aSource
lifts a plain 'These c a' value into a chronicle
mMonadChronicle
instance.
(Monad (MaybeT m), MonadChronicle c m) => MonadChronicle c (MaybeT m)  
(Monad (IdentityT m), MonadChronicle c m) => MonadChronicle c (IdentityT m)  
(Monad (These c), Monoid c) => MonadChronicle c (These c)  
(Monad (WriterT w m), Monoid w, MonadChronicle c m) => MonadChronicle c (WriterT w m)  
(Monad (WriterT w m), Monoid w, MonadChronicle c m) => MonadChronicle c (WriterT w m)  
(Monad (StateT s m), MonadChronicle c m) => MonadChronicle c (StateT s m)  
(Monad (StateT s m), MonadChronicle c m) => MonadChronicle c (StateT s m)  
(Monad (ReaderT r m), MonadChronicle c m) => MonadChronicle c (ReaderT r m)  
(Monad (ErrorT e m), Error e, MonadChronicle c m) => MonadChronicle c (ErrorT e m)  
(Monad (ChronicleT c m), Monoid c, Monad m) => MonadChronicle c (ChronicleT c m)  
(Monad (RWST r w s m), Monoid w, MonadChronicle c m) => MonadChronicle c (RWST r w s m)  
(Monad (RWST r w s m), Monoid w, MonadChronicle c m) => MonadChronicle c (RWST r w s m) 
The ChronicleT monad transformer
type Chronicle c = ChronicleT c IdentitySource
runChronicle :: Chronicle c a > These c aSource
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  

module Data.Monoid
module Control.Monad
module Control.Monad.Trans