Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Flow es = FlowT es Identity
- runFlow :: Flow es a -> V (a ': es)
- data FlowT es m a
- runFlowT :: FlowT es m a -> m (V (a ': es))
- runFlowT_ :: Functor m => FlowT es m a -> m ()
- evalFlowT :: Monad m => FlowT '[] m a -> m a
- evalCatchFlowT :: Monad m => (V es -> m a) -> FlowT es m a -> m a
- injectFlowT :: Monad m => FlowT es m a -> FlowT es m (V (a ': es))
- mapFlowT :: (m (V (a ': es)) -> n (V (b ': es'))) -> FlowT es m a -> FlowT es' n b
- liftFlowT :: (Monad m, LiftVariant es es') => FlowT es m a -> FlowT es' m a
- variantToFlowT :: Monad m => V (a ': es) -> FlowT es m a
- success :: Monad m => a -> FlowT '[] m a
- failure :: Monad m => e -> FlowT '[e] m a
- throwE :: (Monad m, e :< es) => e -> FlowT es m a
- catchE :: forall e es' es'' es a m. (Monad m, e :< es, LiftVariant (Remove e es) es', LiftVariant es'' es') => FlowT es m a -> (e -> FlowT es'' m a) -> FlowT es' m a
- catchLiftBoth :: forall e es' es'' es a m. (Monad m, e :< es, LiftVariant (Remove e es) es', LiftVariant es'' es') => FlowT es m a -> (e -> FlowT es'' m a) -> FlowT es' m a
- catchLiftLeft :: forall e es es' a m. (Monad m, e :< es, LiftVariant (Remove e es) es') => FlowT es m a -> (e -> FlowT es' m a) -> FlowT es' m a
- catchLiftRight :: forall e es es' a m. (Monad m, e :< es, LiftVariant es' (Remove e es)) => FlowT es m a -> (e -> FlowT es' m a) -> FlowT (Remove e es) m a
- catchAllE :: Monad m => FlowT es m a -> (V es -> FlowT es' m a) -> FlowT es' m a
- catchDie :: (e :< es, Monad m) => FlowT es m a -> (e -> m ()) -> FlowT (Remove e es) m a
- catchRemove :: forall e es a m. Monad m => FlowT (e ': es) m a -> (e -> FlowT es m a) -> FlowT es m a
- onFlowError_ :: Monad m => FlowT es m a -> m () -> FlowT es m a
- onFlowError :: Monad m => FlowT es m a -> (V es -> m ()) -> FlowT es m a
- finallyFlow :: Monad m => FlowT es m a -> m () -> FlowT es m a
- module Haskus.Utils.Variant
Documentation
FlowT
Instances
MonadTrans (FlowT e) Source # | |
Defined in Haskus.Utils.Variant.Flow | |
Monad m => Monad (FlowT es m) Source # | |
Functor m => Functor (FlowT es m) Source # | |
(Functor m, Monad m) => Applicative (FlowT es m) Source # | |
Defined in Haskus.Utils.Variant.Flow | |
Foldable m => Foldable (FlowT es m) Source # | |
Defined in Haskus.Utils.Variant.Flow fold :: Monoid m0 => FlowT es m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> FlowT es m a -> m0 # foldr :: (a -> b -> b) -> b -> FlowT es m a -> b # foldr' :: (a -> b -> b) -> b -> FlowT es m a -> b # foldl :: (b -> a -> b) -> b -> FlowT es m a -> b # foldl' :: (b -> a -> b) -> b -> FlowT es m a -> b # foldr1 :: (a -> a -> a) -> FlowT es m a -> a # foldl1 :: (a -> a -> a) -> FlowT es m a -> a # toList :: FlowT es m a -> [a] # null :: FlowT es m a -> Bool # length :: FlowT es m a -> Int # elem :: Eq a => a -> FlowT es m a -> Bool # maximum :: Ord a => FlowT es m a -> a # minimum :: Ord a => FlowT es m a -> a # | |
Traversable m => Traversable (FlowT es m) Source # | |
Defined in Haskus.Utils.Variant.Flow | |
MonadIO m => MonadIO (FlowT es m) Source # | |
Defined in Haskus.Utils.Variant.Flow | |
MonadThrow m => MonadThrow (FlowT e m) Source # | Throws exceptions into the base monad. |
Defined in Haskus.Utils.Variant.Flow | |
MonadCatch m => MonadCatch (FlowT e m) Source # | Catches exceptions from the base monad. |
MonadMask m => MonadMask (FlowT e m) Source # | |
Defined in Haskus.Utils.Variant.Flow | |
MonadInIO m => MonadInIO (FlowT es m) Source # | |
Show (m (V (a ': es))) => Show (FlowT es m a) Source # | |
evalCatchFlowT :: Monad m => (V es -> m a) -> FlowT es m a -> m a Source #
Evaluate a FlowT. Use the provided function to handle error cases.
liftFlowT :: (Monad m, LiftVariant es es') => FlowT es m a -> FlowT es' m a Source #
Lift a FlowT into another
catchE :: forall e es' es'' es a m. (Monad m, e :< es, LiftVariant (Remove e es) es', LiftVariant es'' es') => FlowT es m a -> (e -> FlowT es'' m a) -> FlowT es' m a Source #
Handle an exception. Lift both normal and exceptional flows into the result flow
catchLiftBoth :: forall e es' es'' es a m. (Monad m, e :< es, LiftVariant (Remove e es) es', LiftVariant es'' es') => FlowT es m a -> (e -> FlowT es'' m a) -> FlowT es' m a Source #
Handle an exception. Lift both normal and exceptional flows into the result flow
catchLiftLeft :: forall e es es' a m. (Monad m, e :< es, LiftVariant (Remove e es) es') => FlowT es m a -> (e -> FlowT es' m a) -> FlowT es' m a Source #
Handle an exception. Lift the remaining errors into the resulting flow
catchLiftRight :: forall e es es' a m. (Monad m, e :< es, LiftVariant es' (Remove e es)) => FlowT es m a -> (e -> FlowT es' m a) -> FlowT (Remove e es) m a Source #
Handle an exception. Lift the handler into the resulting flow
catchAllE :: Monad m => FlowT es m a -> (V es -> FlowT es' m a) -> FlowT es' m a Source #
Do something in case of error
catchDie :: (e :< es, Monad m) => FlowT es m a -> (e -> m ()) -> FlowT (Remove e es) m a Source #
Catch and die in case of error
catchRemove :: forall e es a m. Monad m => FlowT (e ': es) m a -> (e -> FlowT es m a) -> FlowT es m a Source #
Handle an exception. Assume it is in the first position
onFlowError_ :: Monad m => FlowT es m a -> m () -> FlowT es m a Source #
Do something in case of error
onFlowError :: Monad m => FlowT es m a -> (V es -> m ()) -> FlowT es m a Source #
Do something in case of error
Reexport
module Haskus.Utils.Variant