pipes-3.1.0: Compositional pipelines

Safe HaskellSafe-Inferred

Control.Proxy.Trans.Either

Contents

Description

This module provides the proxy transformer equivalent of EitherT.

Synopsis

EitherP

newtype EitherP e p a' a b' b m r Source

The Either proxy transformer

Constructors

EitherP 

Fields

runEitherP :: p a' a b' b m (Either e r)
 

Instances

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

runEitherK :: (q -> EitherP e p a' a b' b m r) -> q -> p a' a b' b m (Either e r)Source

Run an EitherP 'K'leisi arrow, returning either a Left or Right

Either operations

left :: (Monad m, Proxy p) => e -> EitherP e p a' a b' b m rSource

Abort the computation and return a Left result

right :: (Monad m, Proxy p) => r -> EitherP e p a' a b' b m rSource

Synonym for return

Symmetric monad

EitherP forms a second symmetric monad over the left type variable.

throw is symmetric to return

catch is symmetric to (>>=)

These two functions obey the monad laws:

 catch m throw = m

 catch (throw e) f = f e

 catch (catch m f) g = catch m (\e -> catch (f e) g)

throw :: (Monad m, Proxy p) => e -> EitherP e p a' a b' b m rSource

Synonym for left

catchSource

Arguments

:: (Monad m, Proxy p) 
=> EitherP e p a' a b' b m r

Original computation

-> (e -> EitherP f p a' a b' b m r)

Handler

-> EitherP f p a' a b' b m r

Handled computation

Resume from an aborted operation

handleSource

Arguments

:: (Monad m, Proxy p) 
=> (e -> EitherP f p a' a b' b m r)

Handler

-> EitherP e p a' a b' b m r

Original computation

-> EitherP f p a' a b' b m r

Handled computation

catch with the arguments flipped