Safe Haskell | None |
---|
A pure implementation of MonadLog using MonadWriter
- type LogSeq = Seq (Priority, String)
- type WriterSeq = WriterT LogSeq
- newtype WriterLogT m a = WriterLogT {
- unwrapWriterLogT :: WriterSeq m a
- type WriterLog = WriterLogT Identity
- runWriterLogT :: WriterLogT m a -> m (a, LogSeq)
- runWriterLog :: WriterLog a -> (a, LogSeq)
- execWriterLogT :: MonadLog m => WriterLogT m a -> m a
- dumpLogSeq :: MonadLog m => LogSeq -> m ()
- execWriterLog :: MonadLog m => WriterLog a -> m a
The data type of the monad transformer
newtype WriterLogT m a Source
A monad transformer that adds pure logging capability.
WriterLogT | |
|
MonadTrans WriterLogT | |
MonadTransControl WriterLogT | |
MonadBase IO m => MonadBase IO (WriterLogT m) | |
MonadBaseControl IO m => MonadBaseControl IO (WriterLogT m) | |
Monad m => Monad (WriterLogT m) | |
Functor m => Functor (WriterLogT m) | |
MonadPlus m => MonadPlus (WriterLogT m) | |
Applicative m => Applicative (WriterLogT m) | |
Alternative m => Alternative (WriterLogT m) | |
MonadIO m => MonadIO (WriterLogT m) | |
Monad m => MonadLog (WriterLogT m) |
type WriterLog = WriterLogT IdentitySource
runWriterLogT :: WriterLogT m a -> m (a, LogSeq)Source
runWriterLog :: WriterLog a -> (a, LogSeq)Source
execWriterLogT :: MonadLog m => WriterLogT m a -> m aSource
Runs a WriterLogT
, and when it finishes, resends all log messages
to the underlying monad that implements MonadLog
.
This can be used to delay logging messages, by accumulating them
in WriterLogT
, and resending them at the end to the underlying monad.
dumpLogSeq :: MonadLog m => LogSeq -> m ()Source
Sends all log messages to the a monad that implements MonadLog
.