Copyright | (c) 2009-2015 Peter Trsko |
---|---|
License | BSD3 |
Stability | provisional |
Portability | NoImplicitPrelude; depends on non-portable module |
Safe Haskell | Safe |
Language | Haskell2010 |
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
- data Throws e m a
- throwsOne :: m a -> Throws e m a
- throwsTwo :: m a -> Throws e' (Throws e m) a
- throwsThree :: m a -> Throws e'' (Throws e' (Throws e m)) a
- hideOne :: Throws e m a -> m a
- hideTwo :: Throws e (Throws e' m) a -> m a
- hideThree :: Throws e (Throws e' (Throws e'' m)) a -> m a
- liftT1 :: (m a -> m b) -> Throws e m a -> Throws e m b
- liftT2 :: (m a -> m b -> m c) -> Throws e m a -> Throws e m b -> Throws e m c
- 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
- insideT :: (m a -> m' b) -> Throws e m a -> Throws e m' b
- insideTf :: Functor f => (f (m a) -> m' b) -> f (Throws e m a) -> Throws e m' b
- insideTf2 :: (Functor f, Functor f') => (f (f' (m a)) -> m' b) -> f (f' (Throws e m a)) -> Throws e m' b
- insideT2 :: (m1 a -> m2 b -> m3 c) -> Throws e m1 a -> Throws e m2 b -> Throws e m3 c
- 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
- joinT :: Throws e (Throws e m) a -> Throws e m a
- joinT3 :: Throws e (Throws e (Throws e m)) a -> Throws e m a
- flipT :: Throws e' (Throws e m) a -> Throws e (Throws e' m) a
- embedT :: (m a -> Throws e n b) -> Throws e m a -> Throws e n b
- 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
- liftBindLike :: (m a -> (b -> m c) -> m d) -> Throws e m a -> (b -> Throws e m c) -> Throws e m d
- liftFlipBindLike :: ((a -> m b) -> m c -> m d) -> (a -> Throws e m b) -> Throws e m c -> Throws e m d
- 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'
- liftCCLike :: (((a -> m b) -> m' c) -> m'' d) -> ((a -> Throws e m b) -> Throws e m' c) -> Throws e m'' d
- liftHoistLike :: (forall a. m a -> n a) -> Throws e m b -> Throws e' n b
- liftEmbedLike :: (forall a. m a -> Throws e n a) -> Throws e' m b -> Throws e n b
Documentation
Exception tag.
throwsOne :: m a -> Throws e m a Source
Construct exception tag, but without MonadThrow
restriction.
throwsThree :: m a -> Throws e'' (Throws e' (Throws e m)) a Source
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.
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.
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 operation similar to the one of mask
.
liftBindLike :: (m a -> (b -> m c) -> m d) -> Throws e m a -> (b -> Throws e m c) -> Throws e m d Source
liftFlipBindLike :: ((a -> m b) -> m c -> m d) -> (a -> Throws e m b) -> Throws e m c -> Throws e m d Source
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
liftCCLike :: (((a -> m b) -> m' c) -> m'' d) -> ((a -> Throws e m b) -> Throws e m' c) -> Throws e m'' d Source
liftHoistLike :: (forall a. m a -> n a) -> Throws e m b -> Throws e' n b Source