tagged-exception-core-2.0.0.0: Reflect exceptions using phantom types.

Copyright(c) 2009 - 2014 Peter Trsko
LicenseBSD3
Stabilityprovisional
Portabilitynon-portable (NoImplicitPrelude)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Monad.TaggedException.Unsafe

Description

Unsafe exception tag cobinators and specific lifting functions. Import this module if creating new MonadException instance(s) that can not be created otherwise.

Preferably import as:

import qualified Control.Monad.TaggedException.Unsafe as Unsafe

Synopsis

Documentation

data Throws e m a Source

Exception tag.

Instances

Typeable (k -> (k -> *) -> k -> *) (Throws k k) 
MFunctor (Throws k * e)

Since 1.2.0.0.

MMonad (Throws k * e)

Since 1.2.0.0.

MonadTrans (Throws k * e) 
Alternative f => Alternative (Throws k * e f) 
Monad m => Monad (Throws k * e m) 
Functor f => Functor (Throws k * e f) 
MonadPlus m => MonadPlus (Throws k * e m) 
Applicative f => Applicative (Throws k * e f) 
MonadThrow m => MonadThrow (Throws k * e m)

Since 2.0.0.0.

MonadCatch m => MonadCatch (Throws k * e m)

Since 2.0.0.0.

MonadMask m => MonadMask (Throws k * e m)

Since 2.0.0.0.

MonadIO m => MonadIO (Throws k * e m) 
Generic (Throws k k e m a) 
type Rep (Throws k k1 e m a) 

throwsOne :: m a -> Throws e m a Source

Construct exception tag, but without MonadThrow restriction.

throwsTwo :: m a -> Throws e' (Throws e m) a Source

Shorthand for throwsOne . throwsOne.

throwsThree :: m a -> Throws e'' (Throws e' (Throws e m)) a Source

Shorthand for throwsOne . throwsOne . throwsOne.

hideOne :: Throws e m a -> m a Source

Hide one exceptions, but without MonadThrow restriction.

hideTwo :: Throws e (Throws e' m) a -> m a Source

Hide two exceptions, but without MonadThrow restriction.

hideThree :: Throws e (Throws e' (Throws e'' m)) a -> m a Source

Hide three exceptions, but without MonadThrow restriction.

liftT1 :: (m a -> m b) -> Throws e m a -> Throws e m b Source

liftT for functions with arity one. Isn't restricted just to MonadThrow instances.

liftT2 :: (m a -> m b -> m c) -> Throws e m a -> Throws e m b -> Throws e m c Source

liftT for functions with arity two. Isn't restricted just to MonadThrow instances.

liftT3 :: (m a -> m b -> m c -> m d) -> Throws e m a -> Throws e m b -> Throws e m c -> Throws e m d Source

liftT for functions with arity three. Isn't restricted just to MonadThrow instances.

insideT :: (m a -> m' b) -> Throws e m a -> Throws e m' b Source

Generalized liftT.

insideTf :: Functor f => (f (m a) -> m' b) -> f (Throws e m a) -> Throws e m' b Source

Variant insideT.

insideTf2 :: (Functor f, Functor f') => (f (f' (m a)) -> m' b) -> f (f' (Throws e m a)) -> Throws e m' b Source

Variant insideT.

insideT2 :: (m1 a -> m2 b -> m3 c) -> Throws e m1 a -> Throws e m2 b -> Throws e m3 c Source

Generalized liftT2.

insideT3 :: (m1 a -> m2 b -> m3 c -> m4 d) -> Throws e m1 a -> Throws e m2 b -> Throws e m3 c -> Throws e m4 d Source

Generalized liftT3.

joinT :: Throws e (Throws e m) a -> Throws e m a Source

Join two exception tags in to one. Isn't restricted just to MonadThrow instances.

joinT3 :: Throws e (Throws e (Throws e m)) a -> Throws e m a Source

Join three exception tags in to one. Isn't restricted just to MonadThrow instances.

flipT :: Throws e' (Throws e m) a -> Throws e (Throws e' m) a Source

Flip two outermost exception tags. Isn't restricted just to MonadThrow instances.

embedT :: (m a -> Throws e n b) -> Throws e m a -> Throws e n b Source

Since 1.2.0.0.

liftMask :: (((forall a. m a -> m a) -> m b) -> m b) -> ((forall a. Throws e m a -> Throws e m a) -> Throws e m b) -> Throws e m b Source

Lift mask operation in to Throws context.

liftBindLike :: (m a -> (b -> m c) -> m d) -> Throws e m a -> (b -> Throws e m c) -> Throws e m d Source

Lift operations with type similar to monadic bind. In example:

(>>=) :: Monad m => m a -> (a -> m b) -> m b
catch
    :: IO a
    -> (IOError -> IO a)
    -> IO a
catch
    :: Exception e
    => IO a -> (e -> IO a) -> IO a

Since 1.2.0.0.

liftFlipBindLike :: ((a -> m b) -> m c -> m d) -> (a -> Throws e m b) -> Throws e m c -> Throws e m d Source

Lift operations with type similar to flipped monadic bind. In example:

(=<<) :: Monad m => (a -> m b) -> m a -> m b
handle
    :: Exception e
    => (e -> IO a) -> IO a -> IO a

Since 1.2.0.0.

liftKleisliLike :: ((a -> m a') -> (b -> m b') -> c -> m c') -> (a -> Throws e m a') -> (b -> Throws e m b') -> c -> Throws e m c' Source

Lift klieisli composition like operations. In example:

(>=>)
    :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
(<=<)
    :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c

Since 1.2.0.0.