Control.Monad.Writer

| Haskell Core Libraries (base package) | Parent | Contents | Index
Control.Monad.Writer |
Portability | non-portable ( mulit-param classes, functional dependencies )
Stability | experimental
Maintainer | libraries@haskell.org
Description
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
Methods
pass :: m (a, w -> w) -> m a
listen :: m a -> m (a, w)
tell :: w -> m ()
Instances
(Error e, MonadWriter w m) => MonadWriter w (ErrorT e m)
(Monoid w) => MonadWriter w (RWS r w s)
(Monoid w, Monad m) => MonadWriter w (RWST r w s m)
(MonadWriter w m) => MonadWriter w (StateT s m)
(Monoid w) => MonadWriter w (Writer w)
(Monoid w, Monad m) => MonadWriter w (WriterT w m)
(MonadWriter w m) => MonadWriter w (ReaderT r m)
listens :: (MonadWriter w m) => (w -> w) -> m a -> m (a, w)
censor :: (MonadWriter w m) => (w -> w) -> m a -> m a
data Writer w a
Constructors
Writer |
runWriter :: (a, w) |
Instances
Functor (Writer w)
(Monoid w) => Monad (Writer w)
(Monoid w) => MonadFix (Writer w)
(Monoid w) => MonadWriter w (Writer w)
runWriter :: Writer w a -> (a, w)
execWriter :: Writer w a -> w
mapWriter :: ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
data WriterT w m a
Constructors
WriterT |
runWriterT :: (m (a, w)) |
Instances
(Monoid w, MonadCont m) => MonadCont (WriterT w m)
(Monoid w, MonadError e m) => MonadError e (WriterT w m)
(Monoid w, MonadState s m) => MonadState s (WriterT w m)
(Monad m) => Functor (WriterT w m)
(Monoid w, Monad m) => Monad (WriterT w m)
(Monoid w, MonadPlus m) => MonadPlus (WriterT w m)
(Monoid w, MonadFix m) => MonadFix (WriterT w m)
(Monoid w, Monad m) => MonadWriter w (WriterT w m)
(Monoid w) => MonadTrans (WriterT w)
(Monoid w, MonadIO m) => MonadIO (WriterT w m)
(Monoid w, MonadReader r m) => MonadReader r (WriterT w m)
runWriterT :: WriterT w m a -> m (a, w)
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.Monoid
module Control.Monad.Fix
module Control.Monad.Trans
Produced by Haddock version 0.3