monad-journal-0.2.1.1: On-the-fly logging typeclass and monad transformer

Portabilityportable
Stabilitystable
Maintainerdimitri.sabadie@gmail.com
Safe HaskellSafe-Inferred

Control.Monad.Journal.Class

Contents

Description

 

Synopsis

MonadJournal

class (Monoid w, Monad m) => MonadJournal w m | m -> w where

Methods

journal :: w -> m ()

Log something.

history :: m w

Extract the logs history.

clear :: m ()

Clear the logs history.

Instances

(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (MaybeT m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (ListT m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (IdentityT m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (EitherT e m) 
(Monad m, Monoid w, Monoid q, MonadJournal w m) => MonadJournal w (WriterT q m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (StateT s m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (ReaderT r m) 
(Monoid w, Monad m) => MonadJournal w (JournalT w m) 
(Monad m, Monoid w, MonadJournal w m) => MonadJournal w (RWST r w s m) 

sink :: (MonadJournal w m, MonadIO m) => (w -> IO ()) -> m ()

Sink all logs history through MonadIO then clean it.

absorb :: MonadJournal w m => (a, w) -> m a

Absorb a logs history and pass around the value.