Safe Haskell | Safe |
---|---|
Language | Haskell98 |
This module provides the proxy transformer equivalent of EitherT
.
- newtype EitherP e p a' a b' b m r = EitherP {
- runEitherP :: p a' a b' b m (Either e r)
- runEitherK :: (q -> EitherP e p a' a b' b m r) -> q -> p a' a b' b m (Either e r)
- left :: (Monad m, Proxy p) => e -> EitherP e p a' a b' b m r
- right :: (Monad m, Proxy p) => r -> EitherP e p a' a b' b m r
- throw :: (Monad m, Proxy p) => e -> EitherP e p a' a b' b m r
- catch :: (Monad m, Proxy p) => EitherP e p a' a b' b m r -> (e -> EitherP f p a' a b' b m r) -> EitherP f p a' a b' b m r
- handle :: (Monad m, Proxy p) => (e -> EitherP f p a' a b' b m r) -> EitherP e p a' a b' b m r -> EitherP f p a' a b' b m r
EitherP
newtype EitherP e p a' a b' b m r Source #
The Either
proxy transformer
EitherP | |
|
ProxyTrans (EitherP e) Source # | |
PFunctor (EitherP e) Source # | |
MonadIOP p => MonadIOP (EitherP e p) Source # | |
MonadPlusP p => MonadPlusP (EitherP e p) Source # | |
Proxy p => Proxy (EitherP e p) Source # | |
Proxy p => MonadTrans (EitherP e p a' a b' b) Source # | |
Proxy p => MFunctor (EitherP e p a' a b' b) Source # | |
(Proxy p, Monad m) => Monad (EitherP e p a' a b' b m) Source # | |
(Proxy p, Monad m) => Functor (EitherP e p a' a b' b m) Source # | |
(Proxy p, Monad m) => Applicative (EitherP e p a' a b' b m) Source # | |
(MonadIOP p, MonadIO m) => MonadIO (EitherP e p a' a b' b m) Source # | |
(MonadPlusP p, Monad m) => Alternative (EitherP e p a' a b' b m) Source # | |
(MonadPlusP p, Monad m) => MonadPlus (EitherP e p a' a b' b m) Source # | |
runEitherK :: (q -> EitherP e p a' a b' b m r) -> q -> p a' a b' b m (Either e r) Source #
Either operations
left :: (Monad m, Proxy p) => e -> EitherP e p a' a b' b m r Source #
Abort the computation and return a Left
result
Symmetric monad
EitherP
forms a second symmetric monad over the left type variable.
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)