graft-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Effect.Error

Documentation

data MonadErrorEffect (e :: Type) :: Effect where Source #

Constructors

ThrowError :: forall (e :: Type) (m :: Type -> Type) (a :: Type). e -> MonadErrorEffect e m a 
CatchError :: forall (e :: Type) (m :: Type -> Type) (a :: Type). (m a) -> (e -> m a) -> MonadErrorEffect e m a 

Instances

Instances details
MonadError e m => InterpretEffectStateful x m (MonadErrorEffect e) Source #

A "passthough" instance for MonadErrorEffects: Modifications are applied in all nested positions of CatchError, but don't actually change the semantics of any MonadErrorEffect.

Instance details

Defined in Effect.Error.Passthrough

Methods

interpretEffectStateful :: forall (ops :: [Effect]) x0 a. (forall b y. x y -> AST ops b -> m (b, x y)) -> x x0 -> MonadErrorEffect e (AST ops) a -> m (a, x x0) Source #

((), MonadError e m) => InterpretEffect m (MonadErrorEffect e) Source # 
Instance details

Defined in Effect.Error

Methods

interpretEffect :: forall (ops :: [Effect]) a. (forall b. AST ops b -> m b) -> MonadErrorEffect e (AST ops) a -> m a Source #

Orphan instances

((), EffectInject (MonadErrorEffect e) ops) => MonadError e (AST ops) Source # 
Instance details

Methods

throwError :: e -> AST ops a #

catchError :: AST ops a -> (e -> AST ops a) -> AST ops a #