monad-levels-0.1.0.0: Specific levels of monad transformers

Copyright(c) Ivan Lazar Miljenovic
License3-Clause BSD-style
MaintainerIvan.Miljenovic@gmail.com
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Levels.Writer

Description

 

Synopsis

Documentation

writer :: forall w m a. HasWriter w m => (a, w) -> m a Source

Embed a simple writer action.

tell :: HasWriter w m => w -> m () Source

An action that produces the output w.

listen :: forall w m a. CanListen w m a => m a -> m (a, w) Source

Execute the action m and add its output to the value of the computation.

pass :: forall w m a. CanPass w m a => m (a, w -> w) -> m a Source

Execute the action m (which returns a value and a function) and returns the value, applying the function to the output.

class (Monoid w, MonadTower m) => IsWriter w m Source

The minimal definition needed for a monad providing a writer environment.

Instances

(Monoid w, MonadTower m) => IsWriter w (WriterT w m) 
(Monoid w, MonadTower m) => IsWriter w (WriterT w m) 
(Monoid w, MonadTower m) => IsWriter w (RWST r w s m) 
(Monoid w, MonadTower m) => IsWriter w (RWST r w s m) 
Monoid w => ValidConstraint (IsWriter w) 
type ConstraintSatisfied (IsWriter w) m