pipes-3.3.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) 
PMonad (EitherP e) 
PFunctor (EitherP e) 
(Proxy p, Monoid e) => MonadPlusP (EitherP e p) 
Proxy p => ProxyInternal (EitherP e p) 
Proxy p => Proxy (EitherP e p) 
Proxy p => MFunctor (EitherP e p a' a b' b) 
Proxy p => MonadTrans (EitherP e p a' a b' b) 
(Monad m, Proxy p) => Monad (EitherP e p a' a b' b m) 
(Monad m, Proxy p) => Functor (EitherP e p a' a b' b m) 
(Monad m, Proxy p, Monoid e) => MonadPlus (EitherP e p a' a b' b m) 
(Monad m, Proxy p) => Applicative (EitherP e p a' a b' b m) 
(Monad m, Proxy p, Monoid e) => Alternative (EitherP e p a' a b' b m) 
(MonadIO m, Proxy p) => 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

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

fmap over the 'L'eft variable