monad-journal-0.7.2: Pure logger typeclass and monad transformer

Copyright | (C) Dimitri Sabadie
License | BSD3
Maintainer | dimitri.sabadie@gmail.com
Stability | stable
Portability | portable
Safe Haskell | None
Language | Haskell2010

Control.Monad.Trans.Journal

Contents

- JournalT monad transformer
- Re-exported

Description

Monad transformer version of `MonadJournal`. `JournalT` provides journaling over a monad.

This modules defines a few useful instances. Check the list below for further information.

Synopsis

- data JournalT w m a
- runJournalT :: (Monoid w, Monad m) => JournalT w m a -> m (a, w)
- evalJournalT :: (Monoid w, Monad m) => JournalT w m a -> m a
- execJournalT :: (Monoid w, Monad m) => JournalT w m a -> m w
- module Control.Monad.Journal.Class

# JournalT monad transformer

data JournalT w m a #

Transformer version of `MonadJournal`.

Instances

MonadBase b m => MonadBase b (JournalT w m) # |
Methods liftBase :: b α -> JournalT w m α #
(Monoid w, MonadBaseControl b m) => MonadBaseControl b (JournalT w m) # |
Associated Types type StM (JournalT w m :: * -> *) a :: * # Methods liftBaseWith :: (RunInBase (JournalT w m) b -> b a) -> JournalT w m a # restoreM :: StM (JournalT w m) a -> JournalT w m a #
MonadError e m => MonadError e (JournalT w m) # |
Methods throwError :: e -> JournalT w m a # catchError :: JournalT w m a -> (e -> JournalT w m a) -> JournalT w m a #
MonadReader r m => MonadReader r (JournalT w m) # |
Methods ask :: JournalT w m r # local :: (r -> r) -> JournalT w m a -> JournalT w m a # reader :: (r -> a) -> JournalT w m a #
MonadState s m => MonadState s (JournalT w m) # |
Methods get :: JournalT w m s # put :: s -> JournalT w m () # state :: (s -> (a, s)) -> JournalT w m a #
MonadWriter w' m => MonadWriter w' (JournalT w m) # |
Methods writer :: (a, w') -> JournalT w m a # tell :: w' -> JournalT w m () # listen :: JournalT w m a -> JournalT w m (a, w') # pass :: JournalT w m (a, w' -> w') -> JournalT w m a #
(Monoid w, Monad m) => MonadJournal w (JournalT w m) # |
Methods journal :: w -> JournalT w m () # history :: JournalT w m w # clear :: JournalT w m () #
MonadTrans (JournalT w) # |
Methods lift :: Monad m => m a -> JournalT w m a #
Monoid w => MonadTransControl (JournalT w) # |
Associated Types type StT (JournalT w :: (* -> *) -> * -> *) a :: * # Methods liftWith :: Monad m => (Run (JournalT w) -> m a) -> JournalT w m a # restoreT :: Monad m => m (StT (JournalT w) a) -> JournalT w m a #
Monad m => Monad (JournalT w m) # |
Methods (>>=) :: JournalT w m a -> (a -> JournalT w m b) -> JournalT w m b # (>>) :: JournalT w m a -> JournalT w m b -> JournalT w m b # return :: a -> JournalT w m a # fail :: String -> JournalT w m a #
Functor m => Functor (JournalT w m) # |
Methods fmap :: (a -> b) -> JournalT w m a -> JournalT w m b # (<$) :: a -> JournalT w m b -> JournalT w m a #
Monad m => Applicative (JournalT w m) # |
Methods pure :: a -> JournalT w m a # (<*>) :: JournalT w m (a -> b) -> JournalT w m a -> JournalT w m b # (*>) :: JournalT w m a -> JournalT w m b -> JournalT w m b # (<*) :: JournalT w m a -> JournalT w m b -> JournalT w m a #
MonadPlus m => MonadPlus (JournalT w m) # |
Methods mzero :: JournalT w m a # mplus :: JournalT w m a -> JournalT w m a -> JournalT w m a #
MonadIO m => MonadIO (JournalT w m) # |
Methods liftIO :: IO a -> JournalT w m a #
MonadPlus m => Alternative (JournalT w m) # |
Methods empty :: JournalT w m a # (<|>) :: JournalT w m a -> JournalT w m a -> JournalT w m a # some :: JournalT w m a -> JournalT w m [a] # many :: JournalT w m a -> JournalT w m [a] #
type StT (JournalT w) a # |
type StT (JournalT w) a = (a, w)
type StM (JournalT w m) a # |
type StM (JournalT w m) a = ComposeSt (JournalT w) m a

runJournalT :: (Monoid w, Monad m) => JournalT w m a -> m (a, w) #

Retrieve the value and the log history.

evalJournalT :: (Monoid w, Monad m) => JournalT w m a -> m a #

Only retrieve the value.

execJournalT :: (Monoid w, Monad m) => JournalT w m a -> m w #

Only retrieve the log history.

# Re-exported

module Control.Monad.Journal.Class