pipes-2.4.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) 
Channel p => Channel (EitherP e p) 
MonadTrans (p a' a b' b) => MonadTrans (EitherP e p a' a b' b) 
MFunctor (p a' a b' b) => MFunctor (EitherP e p a' a b' b) 
Monad (p a' a b' b m) => Monad (EitherP e p a' a b' b m) 
Monad (p a' a b' b m) => Functor (EitherP e p a' a b' b m) 
(Monad (EitherP e p a' a b' b m), MonadPlus (p a' a b' b m)) => MonadPlus (EitherP e p a' a b' b m) 
(Functor (EitherP e p a' a b' b m), Monad (p a' a b' b m)) => Applicative (EitherP e p a' a b' b m) 
(Applicative (EitherP e p a' a b' b m), MonadPlus (p a' a b' b m)) => Alternative (EitherP e p a' a b' b m) 
(Monad (EitherP e p a' a b' b m), MonadIO (p a' a b' b 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 (p a' a b' b m) => e -> EitherP e p a' a b' b m rSource

Abort the computation and return a Left result

right :: Monad (p a' a b' b m) => 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 (p a' a b' b m) => e -> EitherP e p a' a b' b m rSource

Synonym for left

catchSource

Arguments

:: Monad (p a' a b' b m) 
=> 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 (p a' a b' b m) 
=> (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