Haskell Hierarchical Libraries (mtl package)Source codeContentsIndex
Portabilitynon-portable (multi-param classes, functional dependencies)

The MonadWriter class.

Inspired by the paper Functional Programming with Overloading and Higher-Order Polymorphism, Mark P Jones (http://www.cse.ogi.edu/~mpj/) Advanced School of Functional Programming, 1995.

class (Monoid w, Monad m) => MonadWriter w m | m -> w where
tell :: w -> m ()
listen :: m a -> m (a, w)
pass :: m (a, w -> w) -> m a
show/hide Instances
Monoid w => MonadWriter w (Writer w)
(Error e, MonadWriter w m) => MonadWriter w (ErrorT e m)
MonadWriter w m => MonadWriter w (ReaderT r m)
MonadWriter w m => MonadWriter w (StateT s m)
(Monoid w, Monad m) => MonadWriter w (WriterT w m)
Monoid w => MonadWriter w (RWS r w s)
(Monoid w, Monad m) => MonadWriter w (RWST r w s m)
listens :: MonadWriter w m => (w -> b) -> m a -> m (a, b)
censor :: MonadWriter w m => (w -> w) -> m a -> m a
newtype Writer w a
runWriter :: (a, w)
show/hide Instances
execWriter :: Writer w a -> w
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
newtype WriterT w m a
runWriterT :: (m (a, w))
show/hide Instances
(Monoid w, MonadError e m) => MonadError e (WriterT w m)
(Monoid w, MonadReader r m) => MonadReader r (WriterT w m)
(Monoid w, MonadState s m) => MonadState s (WriterT w m)
(Monoid w, Monad m) => MonadWriter w (WriterT w m)
Monoid w => MonadTrans (WriterT w)
Monad m => Functor (WriterT w m)
(Monoid w, Monad m) => Monad (WriterT w m)
(Monoid w, MonadCont m) => MonadCont (WriterT w m)
(Monoid w, MonadFix m) => MonadFix (WriterT w m)
(Monoid w, MonadIO m) => MonadIO (WriterT w m)
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m)
execWriterT :: Monad m => WriterT w m a -> m w
mapWriterT :: (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
module Control.Monad
module Control.Monad.Fix
module Control.Monad.Trans
module Data.Monoid
Produced by Haddock version 0.8