rio-0.1.8.0: A standard library for Haskell

Safe Haskell | Safe
Language | Haskell2010

RIO.Writer

Description

Provides reexports of `MonadWriter` and related helpers.

Since: 0.1.4.0

# Documentation

class (Monoid w, Monad m) => MonadWriter w (m :: Type -> Type) | m -> w where Source #

Minimal complete definition

(writer | tell), listen, pass

Methods

writer :: (a, w) -> m a Source #

``writer` (a,w)` embeds a simple writer action.

tell :: w -> m () Source #

``tell` w` is an action that produces the output `w`.

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

``listen` m` is an action that executes the action `m` and adds its output to the value of the computation.

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

``pass` m` is an action that executes the action `m`, which returns a value and a function, and returns the value, applying the function to the output.

Instances

(Monoid w, HasWriteRef w env) => MonadWriter w (RIO env) Source # |
Instance details Defined in RIO.Prelude.RIO Methods writer :: (a, w) -> RIO env a Source # tell :: w -> RIO env () Source # listen :: RIO env a -> RIO env (a, w) Source # pass :: RIO env (a, w -> w) -> RIO env a Source #
MonadWriter w m => MonadWriter w (MaybeT m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> MaybeT m a Source # tell :: w -> MaybeT m () Source # listen :: MaybeT m a -> MaybeT m (a, w) Source # pass :: MaybeT m (a, w -> w) -> MaybeT m a Source #
Monoid w => MonadWriter w ((,) w) | NOTE: This instance is only defined for `base >= 4.9.0`. Since: mtl-2.2.2
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> (w, a) Source # tell :: w -> (w, ()) Source # listen :: (w, a) -> (w, (a, w)) Source # pass :: (w, (a, w -> w)) -> (w, a) Source #
(Monoid w, Monad m) => MonadWriter w (WriterT w m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> WriterT w m a Source # tell :: w -> WriterT w m () Source # listen :: WriterT w m a -> WriterT w m (a, w) Source # pass :: WriterT w m (a, w -> w) -> WriterT w m a Source #
(Monoid w, Monad m) => MonadWriter w (WriterT w m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> WriterT w m a Source # tell :: w -> WriterT w m () Source # listen :: WriterT w m a -> WriterT w m (a, w) Source # pass :: WriterT w m (a, w -> w) -> WriterT w m a Source #
MonadWriter w m => MonadWriter w (StateT s m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> StateT s m a Source # tell :: w -> StateT s m () Source # listen :: StateT s m a -> StateT s m (a, w) Source # pass :: StateT s m (a, w -> w) -> StateT s m a Source #
MonadWriter w m => MonadWriter w (StateT s m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> StateT s m a Source # tell :: w -> StateT s m () Source # listen :: StateT s m a -> StateT s m (a, w) Source # pass :: StateT s m (a, w -> w) -> StateT s m a Source #
MonadWriter w m => MonadWriter w (ReaderT r m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> ReaderT r m a Source # tell :: w -> ReaderT r m () Source # listen :: ReaderT r m a -> ReaderT r m (a, w) Source # pass :: ReaderT r m (a, w -> w) -> ReaderT r m a Source #
MonadWriter w m => MonadWriter w (IdentityT m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> IdentityT m a Source # tell :: w -> IdentityT m () Source # listen :: IdentityT m a -> IdentityT m (a, w) Source # pass :: IdentityT m (a, w -> w) -> IdentityT m a Source #
MonadWriter w m => MonadWriter w (ExceptT e m) | Since: mtl-2.2
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> ExceptT e m a Source # tell :: w -> ExceptT e m () Source # listen :: ExceptT e m a -> ExceptT e m (a, w) Source # pass :: ExceptT e m (a, w -> w) -> ExceptT e m a Source #
(Error e, MonadWriter w m) => MonadWriter w (ErrorT e m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> ErrorT e m a Source # tell :: w -> ErrorT e m () Source # listen :: ErrorT e m a -> ErrorT e m (a, w) Source # pass :: ErrorT e m (a, w -> w) -> ErrorT e m a Source #
(Monoid w, Monad m) => MonadWriter w (RWST r w s m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> RWST r w s m a Source # tell :: w -> RWST r w s m () Source # listen :: RWST r w s m a -> RWST r w s m (a, w) Source # pass :: RWST r w s m (a, w -> w) -> RWST r w s m a Source #
(Monoid w, Monad m) => MonadWriter w (RWST r w s m) |
Instance details Defined in Control.Monad.Writer.Class Methods writer :: (a, w) -> RWST r w s m a Source # tell :: w -> RWST r w s m () Source # listen :: RWST r w s m a -> RWST r w s m (a, w) Source # pass :: RWST r w s m (a, w -> w) -> RWST r w s m a Source #