pipes-2.5.0: Compositional pipelines

Safe HaskellSafe
LanguageHaskell98

Control.Proxy.Trans.Writer

Contents

Description

This module provides the proxy transformer equivalent of WriterT.

This module is even stricter than Control.Monad.Trans.Writer.Strict by being strict in the accumulated monoid.

The underlying implementation uses the state monad to avoid quadratic blowup from left-associative binds.

Synopsis

WriterP

newtype WriterP w p a' a b' b m r Source #

The strict Writer proxy transformer

Constructors

WriterP 

Fields

Instances

Monoid w => ProxyTrans (WriterP w) Source # 

Methods

liftP :: (Monad (p b c d e m), Channel p) => p b c d e m r -> WriterP w p b c d e m r Source #

mapP :: (Monad (p b c d e m), Channel p) => (a -> p b c d e m r) -> a -> WriterP w p b c d e m r Source #

Channel p => Channel (WriterP w p) Source # 

Methods

idT :: Monad m => a' -> WriterP w p a' a a' a m r Source #

(>->) :: Monad m => (b' -> WriterP w p a' a b' b m r) -> (c' -> WriterP w p b' b c' c m r) -> c' -> WriterP w p a' a c' c m r Source #

(<-<) :: Monad m => (c' -> WriterP w p b' b c' c m r) -> (b' -> WriterP w p a' a b' b m r) -> c' -> WriterP w p a' a c' c m r Source #

MonadTrans (p a' a b' b) => MonadTrans (WriterP w p a' a b' b) Source # 

Methods

lift :: Monad m => m a -> WriterP w p a' a b' b m a #

MFunctor (p a' a b' b) => MFunctor (WriterP w p a' a b' b) Source # 

Methods

mapT :: (Monad m, Monad n) => (forall c. m c -> n c) -> WriterP w p a' a b' b m b -> WriterP w p a' a b' b n b Source #

Monad (p a' a b' b m) => Monad (WriterP w p a' a b' b m) Source # 

Methods

(>>=) :: WriterP w p a' a b' b m a -> (a -> WriterP w p a' a b' b m b) -> WriterP w p a' a b' b m b #

(>>) :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m b -> WriterP w p a' a b' b m b #

return :: a -> WriterP w p a' a b' b m a #

fail :: String -> WriterP w p a' a b' b m a #

Monad (p a' a b' b m) => Functor (WriterP w p a' a b' b m) Source # 

Methods

fmap :: (a -> b) -> WriterP w p a' a b' b m a -> WriterP w p a' a b' b m b #

(<$) :: a -> WriterP w p a' a b' b m b -> WriterP w p a' a b' b m a #

Monad (p a' a b' b m) => Applicative (WriterP w p a' a b' b m) Source # 

Methods

pure :: a -> WriterP w p a' a b' b m a #

(<*>) :: WriterP w p a' a b' b m (a -> b) -> WriterP w p a' a b' b m a -> WriterP w p a' a b' b m b #

(*>) :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m b -> WriterP w p a' a b' b m b #

(<*) :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m b -> WriterP w p a' a b' b m a #

MonadIO (p a' a b' b m) => MonadIO (WriterP w p a' a b' b m) Source # 

Methods

liftIO :: IO a -> WriterP w p a' a b' b m a #

MonadPlus (p a' a b' b m) => Alternative (WriterP w p a' a b' b m) Source # 

Methods

empty :: WriterP w p a' a b' b m a #

(<|>) :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m a -> WriterP w p a' a b' b m a #

some :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m [a] #

many :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m [a] #

MonadPlus (p a' a b' b m) => MonadPlus (WriterP w p a' a b' b m) Source # 

Methods

mzero :: WriterP w p a' a b' b m a #

mplus :: WriterP w p a' a b' b m a -> WriterP w p a' a b' b m a -> WriterP w p a' a b' b m a #

runWriterP :: Monoid w => WriterP w p a' a b' b m r -> p a' a b' b m (r, w) Source #

Run a WriterP computation, producing the final result and monoid

runWriterK :: Monoid w => (q -> WriterP w p a' a b' b m r) -> q -> p a' a b' b m (r, w) Source #

Run a WriterP 'K'leisli arrow, producing the final result and monoid

execWriterP :: (Monad (p a' a b' b m), Monoid w) => WriterP w p a' a b' b m r -> p a' a b' b m w Source #

Evaluate a WriterP computation, but discard the final result

execWriterK :: (Monad (p a' a b' b m), Monoid w) => (q -> WriterP w p a' a b' b m r) -> q -> p a' a b' b m w Source #

Evaluate a WriterP 'K'leisli arrow, but discard the final result

Writer operations

tell :: (Monad (p a' a b' b m), Monoid w) => w -> WriterP w p a' a b' b m () Source #

Add a value to the monoid

censor :: (Monad (p a' a b' b m), Monoid w) => (w -> w) -> WriterP w p a' a b' b m r -> WriterP w p a' a b' b m r Source #

Modify the result of a writer computation