monads-tf-0.1.0.3: Monad classes, using type families

Copyright(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001
LicenseBSD-style (see the file LICENSE)
Maintainerross@soi.city.ac.uk
Stabilityexperimental
Portabilitynon-portable (type families)
Safe HaskellSafe
LanguageHaskell98

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 (WriterType m), Monad m) => MonadWriter m where Source #

Minimal complete definition

tell, listen, pass

Associated Types

type WriterType m Source #

Methods

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

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

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

Instances

MonadWriter m => MonadWriter (MaybeT m) Source # 

Associated Types

type WriterType (MaybeT m :: * -> *) :: * Source #

Methods

tell :: WriterType (MaybeT m) -> MaybeT m () Source #

listen :: MaybeT m a -> MaybeT m (a, WriterType (MaybeT m)) Source #

pass :: MaybeT m (a, WriterType (MaybeT m) -> WriterType (MaybeT m)) -> MaybeT m a Source #

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

Associated Types

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

Methods

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

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

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

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

Associated Types

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

Methods

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

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

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

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

Associated Types

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

Methods

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

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

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

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

Associated Types

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

Methods

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

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

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

MonadWriter m => MonadWriter (IdentityT * m) Source # 

Associated Types

type WriterType (IdentityT * m :: * -> *) :: * Source #

(Error e, MonadWriter m) => MonadWriter (ErrorT e m) Source # 

Associated Types

type WriterType (ErrorT e m :: * -> *) :: * Source #

Methods

tell :: WriterType (ErrorT e m) -> ErrorT e m () Source #

listen :: ErrorT e m a -> ErrorT e m (a, WriterType (ErrorT e m)) Source #

pass :: ErrorT e m (a, WriterType (ErrorT e m) -> WriterType (ErrorT e m)) -> ErrorT e m a Source #

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

Associated Types

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

Methods

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

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

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

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

Associated Types

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

Methods

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

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

pass :: RWST r w s m (a, WriterType (RWST r w s m) -> WriterType (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 WriterType (RWST r w s m :: * -> *) :: * Source #

Methods

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

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

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

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

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