pipes-2.4.0: Compositional pipelines

Safe HaskellSafe
LanguageHaskell2010

Control.Proxy.Trans.Reader

Contents

Description

This module provides the proxy transformer equivalent of ReaderT.

Synopsis

ReaderP

newtype ReaderP i p a' a b' b m r Source #

The Reader proxy transformer

Constructors

ReaderP 

Fields

Instances

ProxyTrans (ReaderP i) Source # 

Methods

liftP :: (Monad (p b c d e m), Channel p) => p b c d e m r -> ReaderP i 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 -> ReaderP i p b c d e m r Source #

Interact p => Interact (ReaderP i p) Source # 

Methods

request :: Monad m => a' -> ReaderP i p a' a x' x m a Source #

(\>\) :: Monad m => (b' -> ReaderP i p a' a x' x m b) -> (c' -> ReaderP i p b' b x' x m c) -> c' -> ReaderP i p a' a x' x m c Source #

(/</) :: Monad m => (c' -> ReaderP i p b' b x' x m c) -> (b' -> ReaderP i p a' a x' x m b) -> c' -> ReaderP i p a' a x' x m c Source #

respond :: Monad m => a -> ReaderP i p x' x a' a m a' Source #

(/>/) :: Monad m => (a -> ReaderP i p x' x b' b m a') -> (b -> ReaderP i p x' x c' c m b') -> a -> ReaderP i p x' x c' c m a' Source #

(\<\) :: Monad m => (b -> ReaderP i p x' x c' c m b') -> (a -> ReaderP i p x' x b' b m a') -> a -> ReaderP i p x' x c' c m a' Source #

Channel p => Channel (ReaderP i p) Source # 

Methods

idT :: Monad m => a' -> ReaderP i p a' a a' a m r Source #

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

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

MonadTrans (p a' a b' b) => MonadTrans (ReaderP i p a' a b' b) Source # 

Methods

lift :: Monad m => m a -> ReaderP i p a' a b' b m a #

MFunctor (p a' a b' b) => MFunctor (ReaderP i p a' a b' b) Source # 

Methods

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

Monad (p a' a b' b m) => Monad (ReaderP i p a' a b' b m) Source # 

Methods

(>>=) :: ReaderP i p a' a b' b m a -> (a -> ReaderP i p a' a b' b m b) -> ReaderP i p a' a b' b m b #

(>>) :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m b -> ReaderP i p a' a b' b m b #

return :: a -> ReaderP i p a' a b' b m a #

fail :: String -> ReaderP i p a' a b' b m a #

Monad (p a' a b' b m) => Functor (ReaderP i p a' a b' b m) Source # 

Methods

fmap :: (a -> b) -> ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m b #

(<$) :: a -> ReaderP i p a' a b' b m b -> ReaderP i p a' a b' b m a #

Monad (p a' a b' b m) => Applicative (ReaderP i p a' a b' b m) Source # 

Methods

pure :: a -> ReaderP i p a' a b' b m a #

(<*>) :: ReaderP i p a' a b' b m (a -> b) -> ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m b #

(*>) :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m b -> ReaderP i p a' a b' b m b #

(<*) :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m b -> ReaderP i p a' a b' b m a #

MonadIO (p a' a b' b m) => MonadIO (ReaderP i p a' a b' b m) Source # 

Methods

liftIO :: IO a -> ReaderP i p a' a b' b m a #

MonadPlus (p a' a b' b m) => Alternative (ReaderP i p a' a b' b m) Source # 

Methods

empty :: ReaderP i p a' a b' b m a #

(<|>) :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m a #

some :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m [a] #

many :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m [a] #

MonadPlus (p a' a b' b m) => MonadPlus (ReaderP i p a' a b' b m) Source # 

Methods

mzero :: ReaderP i p a' a b' b m a #

mplus :: ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m a -> ReaderP i p a' a b' b m a #

runReaderP :: i -> ReaderP i p a' a b' b m r -> p a' a b' b m r Source #

Run a ReaderP computation, supplying the environment

runReaderK :: i -> (q -> ReaderP i p a' a b' b m r) -> q -> p a' a b' b m r Source #

Run a ReaderP 'K'leisli arrow, supplying the environment

withReaderP :: Monad (p a' a b' b m) => (j -> i) -> ReaderP i p a' a b' b m r -> ReaderP j p a' a b' b m r Source #

Modify a computation's environment (a more general version of local)

Reader operations

ask :: Monad (p a' a b' b m) => ReaderP i p a' a b' b m i Source #

Get the environment

local :: Monad (p a' a b' b m) => (i -> i) -> ReaderP i p a' a b' b m r -> ReaderP i p a' a b' b m r Source #

Modify a computation's environment (a specialization of withReaderP)

asks :: Monad (p a' a b' b m) => (i -> r) -> ReaderP i p a' a b' b m r Source #

Get a function of the environment