mtl-tf-0.2.1.0: Monad Transformer Library with Type Families

Copyright(c) Andy Gill 2001
(c) Oregon Graduate Institute of Science and Technology 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilityexperimental
Portabilitynon-portable (multi-param classes, functional dependencies)
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Writer.Class

Description

The MonadWriter class.

Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995.

Documentation

class (Monoid (WritType m), Monad m) => MonadWriter m where Source #

Minimal complete definition

tell, listen, pass

Associated Types

type WritType m Source #

Methods

tell :: WritType m -> m () Source #

listen :: m a -> m (a, WritType m) Source #

pass :: m (a, WritType m -> WritType m) -> m a Source #

Instances

(Monoid w, Monad m) => MonadWriter (WriterT w m) Source # 

Associated Types

type WritType (WriterT w m :: * -> *) :: * Source #

Methods

tell :: WritType (WriterT w m) -> WriterT w m () Source #

listen :: WriterT w m a -> WriterT w m (a, WritType (WriterT w m)) Source #

pass :: WriterT w m (a, WritType (WriterT w m) -> WritType (WriterT w m)) -> WriterT w m a Source #

(Monoid w, Monad m) => MonadWriter (WriterT w m) Source # 

Associated Types

type WritType (WriterT w m :: * -> *) :: * Source #

Methods

tell :: WritType (WriterT w m) -> WriterT w m () Source #

listen :: WriterT w m a -> WriterT w m (a, WritType (WriterT w m)) Source #

pass :: WriterT w m (a, WritType (WriterT w m) -> WritType (WriterT w m)) -> WriterT w m a Source #

MonadWriter m => MonadWriter (StateT s m) Source # 

Associated Types

type WritType (StateT s m :: * -> *) :: * Source #

Methods

tell :: WritType (StateT s m) -> StateT s m () Source #

listen :: StateT s m a -> StateT s m (a, WritType (StateT s m)) Source #

pass :: StateT s m (a, WritType (StateT s m) -> WritType (StateT s m)) -> StateT s m a Source #

MonadWriter m => MonadWriter (StateT s m) Source # 

Associated Types

type WritType (StateT s m :: * -> *) :: * Source #

Methods

tell :: WritType (StateT s m) -> StateT s m () Source #

listen :: StateT s m a -> StateT s m (a, WritType (StateT s m)) Source #

pass :: StateT s m (a, WritType (StateT s m) -> WritType (StateT s m)) -> StateT s m a Source #

MonadWriter m => MonadWriter (ExceptT e m) Source # 

Associated Types

type WritType (ExceptT e m :: * -> *) :: * Source #

Methods

tell :: WritType (ExceptT e m) -> ExceptT e m () Source #

listen :: ExceptT e m a -> ExceptT e m (a, WritType (ExceptT e m)) Source #

pass :: ExceptT e m (a, WritType (ExceptT e m) -> WritType (ExceptT e m)) -> ExceptT e m a Source #

MonadWriter m => MonadWriter (ReaderT * r m) Source # 

Associated Types

type WritType (ReaderT * r m :: * -> *) :: * Source #

Methods

tell :: WritType (ReaderT * r m) -> ReaderT * r m () Source #

listen :: ReaderT * r m a -> ReaderT * r m (a, WritType (ReaderT * r m)) Source #

pass :: ReaderT * r m (a, WritType (ReaderT * r m) -> WritType (ReaderT * r m)) -> ReaderT * r m a Source #

(Monoid w, Monad m) => MonadWriter (RWST r w s m) Source # 

Associated Types

type WritType (RWST r w s m :: * -> *) :: * Source #

Methods

tell :: WritType (RWST r w s m) -> RWST r w s m () Source #

listen :: RWST r w s m a -> RWST r w s m (a, WritType (RWST r w s m)) Source #

pass :: RWST r w s m (a, WritType (RWST r w s m) -> WritType (RWST r w s m)) -> RWST r w s m a Source #

(Monoid w, Monad m) => MonadWriter (RWST r w s m) Source # 

Associated Types

type WritType (RWST r w s m :: * -> *) :: * Source #

Methods

tell :: WritType (RWST r w s m) -> RWST r w s m () Source #

listen :: RWST r w s m a -> RWST r w s m (a, WritType (RWST r w s m)) Source #

pass :: RWST r w s m (a, WritType (RWST r w s m) -> WritType (RWST r w s m)) -> RWST r w s m a Source #

listens :: MonadWriter m => (WritType m -> b) -> m a -> m (a, b) Source #

censor :: MonadWriter m => (WritType m -> WritType m) -> m a -> m a Source #