Copyright | (c) 2009 - 2014 Peter Trsko |
---|---|

License | BSD3 |

Stability | provisional |

Portability | non-portable (NoImplicitPrelude) |

Safe Haskell | Safe-Inferred |

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'

# Documentation

Exception tag.

Typeable (k -> (k -> *) -> k -> *) (Throws k k) | |

MFunctor (Throws k * e) | Since |

MMonad (Throws k * e) | Since |

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 |

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

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

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.

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 `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

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