pipes-3.1.0: Compositional pipelines

Safe HaskellSafe-Inferred

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

unReaderP :: i -> p a' a b' b m r
 

Instances

ProxyTrans (ReaderP i) 
PFunctor (ReaderP i) 
(Proxy (ReaderP i p), MonadIOP p) => MonadIOP (ReaderP i p) 
(Proxy (ReaderP i p), MonadPlusP p) => MonadPlusP (ReaderP i p) 
Interact p => Interact (ReaderP i p) 
Proxy p => Proxy (ReaderP i p) 
Proxy p => MonadTrans (ReaderP i p a' a b' b) 
Proxy p => MFunctor (ReaderP i p a' a b' b) 
(Proxy p, Monad m) => Monad (ReaderP i p a' a b' b m) 
(Proxy p, Monad m) => Functor (ReaderP i p a' a b' b m) 
(Monad (ReaderP i p a' a b' b m), MonadPlusP p, Monad m) => MonadPlus (ReaderP i p a' a b' b m) 
(Functor (ReaderP i p a' a b' b m), Proxy p, Monad m) => Applicative (ReaderP i p a' a b' b m) 
(Applicative (ReaderP i p a' a b' b m), MonadPlusP p, Monad m) => Alternative (ReaderP i p a' a b' b m) 
(Monad (ReaderP i p a' a b' b m), MonadIOP p, MonadIO m) => MonadIO (ReaderP i p a' a b' b m) 

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

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 rSource

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

Reader operations

ask :: (Proxy p, Monad m) => ReaderP i p a' a b' b m iSource

Get the environment

asks :: (Proxy p, Monad m) => (i -> r) -> ReaderP i p a' a b' b m rSource

Get a function of the environment

local :: (i -> i) -> ReaderP i p a' a b' b m r -> ReaderP i p a' a b' b m rSource

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

withReaderP :: (j -> i) -> ReaderP i p a' a b' b m r -> ReaderP j p a' a b' b m rSource

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