in-other-words-0.1.1.0: A higher-order effect system where the sky's the limit
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Error

Synopsis

Effects

newtype Throw e (m :: * -> *) (a :: *) where Source #

An effect for throwing exceptions of type e.

Constructors

Throw :: e -> Throw e m a 

data Catch e :: Effect where Source #

An effect for catching exceptions of type e.

Constructors

Catch :: m a -> (e -> m a) -> Catch e m a 

type Error e = Bundle '[Throw e, Catch e] Source #

A pseudo-effect for connected Throw e and Catch e effects.

Error e should only ever be used inside of Eff and Effs constraints. It is not a real effect! See Bundle.

Actions

throw :: Eff (Throw e) m => e -> m a Source #

catch :: Eff (Catch e) m => m a -> (e -> m a) -> m a Source #

try :: Eff (Catch e) m => m a -> m (Either e a) Source #

catchJust :: forall smallExc bigExc m a. Eff (Error bigExc) m => (bigExc -> Maybe smallExc) -> m a -> (smallExc -> m a) -> m a Source #

tryJust :: forall smallExc bigExc m a. Eff (Error bigExc) m => (bigExc -> Maybe smallExc) -> m a -> m (Either smallExc a) Source #

note :: Eff (Throw e) m => e -> Maybe a -> m a Source #

fromEither :: Eff (Throw e) m => Either e a -> m a Source #

Main Interpreters

runThrow :: forall e m a p. (Carrier m, Threaders '[ErrorThreads] m p) => ThrowC e m a -> m (Either e a) Source #

Run a Throw effect purely.

Unlike runError, this does not provide the ability to catch exceptions. However, it also doesn't impose any primitive effects, meaning runThrow doesn't restrict what interpreters are run before it.

Derivs (ThrowC e m) = Throw e ': Derivs m
Prims  (ThrowC e m) = Prims m

runError :: forall e m a p. (Carrier m, Threaders '[ErrorThreads] m p) => ErrorC e m a -> m (Either e a) Source #

Runs connected Throw and Catch effects -- i.e. Error -- purely.

Derivs (ErrorC e m) = Catch e ': Throw e ': Derivs m
Prims  (ErrorC e m) = Optional ((->) e) ': Prims m

errorToIO :: forall e m a. (MonadCatch m, Eff (Embed IO) m) => ErrorToIOC e m a -> m (Either e a) Source #

Runs connected Throw and Catch effects -- i.e. Error -- by making use of IO exceptions.

Derivs (ErrorToIOC e m) = Catch e ': Throw e ': Derivs m
Prims  (ErrorToIOC e m) = Optional ((->) SomeException) ': Prims m

This has a higher-rank type, as it makes use of ErrorToIOC. This makes errorToIO very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower errorToIOSimple, which doesn't have a higher-rank type.

Other interpreters

errorToErrorIO :: forall e m a. Effs '[ErrorIO, Embed IO] m => InterpretErrorC e m a -> m (Either e a) Source #

Runs connected Throw and Catch effects -- i.e. Error -- by transforming them into ErrorIO and Embed IO

This has a higher-rank type, as it makes use of InterpretErrorC. This makes errorToErrorIO very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower throwToThrowSimple, which doesn't have a higher-rank type.

throwToThrow :: forall smallExc bigExc m a. Eff (Throw bigExc) m => (smallExc -> bigExc) -> InterpretReifiedC (Throw smallExc) m a -> m a Source #

Transforms a Throw smallExc effect into a Throw bigExc effect, by providing a function to convert exceptions of the smaller exception type smallExc to the larger exception type bigExc.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes throwToThrow very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower throwToThrowSimple, which doesn't have a higher-rank type.

catchToError :: forall smallExc bigExc m a. Eff (Error bigExc) m => (bigExc -> Maybe smallExc) -> InterpretReifiedC (Catch smallExc) m a -> m a Source #

Transforms a Catch smallExc effect into an Error bigExc effect, by providing a function that identifies when exceptions of the larger exception type bigExc correspond to exceptions of the smaller exception type smallExc.

This has a higher-rank type, as it makes use of InterpretReifiedC. This makes catchToError very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower catchToErrorSimple, which doesn't have a higher-rank type.

errorToError :: forall smallExc bigExc m a. Eff (Error bigExc) m => (smallExc -> bigExc) -> (bigExc -> Maybe smallExc) -> InterpretErrorC smallExc m a -> m a Source #

Transforms connected Throw and Catch effects -- i.e. Error -- into another Error effect by providing functions to convert between the two types of exceptions.

This has a higher-rank type, as it makes use of InterpretErrorC. This makes errorToError very difficult to use partially applied. In particular, it can't be composed using ..

If performance is secondary, consider using the slower errorToErrorSimple, which doesn't have a higher-rank type.

Simple variants

errorToIOSimple :: forall e m a p. (Eff (Embed IO) m, MonadCatch m, Threaders '[ReaderThreads] m p) => ErrorToIOSimpleC e m a -> m (Either e a) Source #

Runs connected Throw and Catch effects -- i.e. Error -- by making use of IO exceptions.

Derivs (ErrorToIOSimpleC e m) = Catch e ': Throw e ': Derivs m
Prims  (ErrorToIOSimpleC e m) = Optional ((->) SomeException) ': Prims m

This is a less performant version of errorToIO that doesn't have a higher-rank type, making it much easier to use partially applied.

errorToErrorIOSimple :: forall e m a p. (Effs '[ErrorIO, Embed IO] m, Threaders '[ReaderThreads] m p) => InterpretErrorSimpleC e m a -> m (Either e a) Source #

Runs connected Throw and Catch effects -- i.e. Error -- by transforming them into ErrorIO and Embed IO

This is a less performant version of errorToErrorIO that doesn't have a higher-rank type, making it much easier to use partially applied.

throwToThrowSimple :: forall smallExc bigExc m a p. (Eff (Throw bigExc) m, Threaders '[ReaderThreads] m p) => (smallExc -> bigExc) -> InterpretSimpleC (Throw smallExc) m a -> m a Source #

Transforms a Throw smallExc effect into a Throw bigExc effect, by providing a function to convert exceptions of the smaller exception type smallExc to the larger exception type bigExc.

This is a less performant version of throwToThrow that doesn't have a higher-rank type, making it much easier to use partially applied.

catchToErrorSimple :: forall smallExc bigExc m a p. (Eff (Error bigExc) m, Threaders '[ReaderThreads] m p) => (bigExc -> Maybe smallExc) -> InterpretSimpleC (Catch smallExc) m a -> m a Source #

Transforms a Catch smallExc effect into an Error bigExc effect, by providing a function that identifies when exceptions of the larger exception type bigExc correspond to exceptions of the smaller exception type smallExc.

This is a less performant version of catchToError that doesn't have a higher-rank type, making it much easier to use partially applied.

errorToErrorSimple :: forall smallExc bigExc m a p. (Eff (Error bigExc) m, Threaders '[ReaderThreads] m p) => (smallExc -> bigExc) -> (bigExc -> Maybe smallExc) -> InterpretErrorSimpleC smallExc m a -> m a Source #

Transforms connected Throw and Catch effects -- i.e. Error -- into another Error effect by providing functions to convert between the two types of exceptions.

This is a less performant version of errorToError that doesn't have a higher-rank type, making it much easier to use partially applied.

Threading constraints

class (forall e. Threads (ExceptT e) p) => ErrorThreads p Source #

ErrorThreads accepts the following primitive effects:

Instances

Instances details
(forall e. Threads (ExceptT e) p) => ErrorThreads p Source # 
Instance details

Defined in Control.Effect.Internal.Error

MonadCatch

class MonadThrow m => MonadCatch (m :: Type -> Type) #

A class for monads which allow exceptions to be caught, in particular exceptions which were thrown by throwM.

Instances should obey the following law:

catch (throwM e) f = f e

Note that the ability to catch an exception does not guarantee that we can deal with all possible exit points from a computation. Some monads, such as continuation-based stacks, allow for more than just a success/failure strategy, and therefore catch cannot be used by those monads to properly implement a function such as finally. For more information, see MonadMask.

Minimal complete definition

catch

Instances

Instances details
MonadCatch IO 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => IO a -> (e -> IO a) -> IO a #

MonadCatch STM 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => STM a -> (e -> STM a) -> STM a #

e ~ SomeException => MonadCatch (Either e)

Since: exceptions-0.8.3

Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e0 => Either e a -> (e0 -> Either e a) -> Either e a #

MonadCatch m => MonadCatch (MaybeT m)

Catches exceptions from the base monad.

Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => MaybeT m a -> (e -> MaybeT m a) -> MaybeT m a #

MonadCatch m => MonadCatch (ListT m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => ListT m a -> (e -> ListT m a) -> ListT m a #

MonadCatch m => MonadCatch (ListT m) Source # 
Instance details

Defined in Control.Monad.Trans.List.Church

Methods

catch :: Exception e => ListT m a -> (e -> ListT m a) -> ListT m a #

MonadCatch m => MonadCatch (NonDetC m) Source # 
Instance details

Defined in Control.Effect.Internal.NonDet

Methods

catch :: Exception e => NonDetC m a -> (e -> NonDetC m a) -> NonDetC m a #

MonadCatch m => MonadCatch (CullCutC m) Source # 
Instance details

Defined in Control.Effect.Internal.NonDet

Methods

catch :: Exception e => CullCutC m a -> (e -> CullCutC m a) -> CullCutC m a #

MonadCatch m => MonadCatch (LogicC m) Source # 
Instance details

Defined in Control.Effect.Internal.NonDet

Methods

catch :: Exception e => LogicC m a -> (e -> LogicC m a) -> LogicC m a #

MonadCatch m => MonadCatch (InterpretFailSimpleC m) Source # 
Instance details

Defined in Control.Effect.Fail

MonadCatch m => MonadCatch (InterpretAltSimpleC m) Source # 
Instance details

Defined in Control.Effect.Alt

MonadCatch m => MonadCatch (ExceptT e m)

Catches exceptions from the base monad.

Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e0 => ExceptT e m a -> (e0 -> ExceptT e m a) -> ExceptT e m a #

(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #

MonadCatch m => MonadCatch (StateT s m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => StateT s m a -> (e -> StateT s m a) -> StateT s m a #

MonadCatch m => MonadCatch (ReaderT r m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => ReaderT r m a -> (e -> ReaderT r m a) -> ReaderT r m a #

(Error e, MonadCatch m) => MonadCatch (ErrorT e m)

Catches exceptions from the base monad.

Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e0 => ErrorT e m a -> (e0 -> ErrorT e m a) -> ErrorT e m a #

MonadCatch m => MonadCatch (IdentityT m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => IdentityT m a -> (e -> IdentityT m a) -> IdentityT m a #

MonadCatch m => MonadCatch (StateT s m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => StateT s m a -> (e -> StateT s m a) -> StateT s m a #

(MonadCatch m, Monoid w) => MonadCatch (WriterT w m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => WriterT w m a -> (e -> WriterT w m a) -> WriterT w m a #

MonadCatch (CompositionBaseT ts m) => MonadCatch (CompositionC ts m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Compose

Methods

catch :: Exception e => CompositionC ts m a -> (e -> CompositionC ts m a) -> CompositionC ts m a #

Eff ErrorIO m => MonadCatch (Effly m) Source # 
Instance details

Defined in Control.Effect.Internal.Effly

Methods

catch :: Exception e => Effly m a -> (e -> Effly m a) -> Effly m a #

MonadCatch m => MonadCatch (InterpretPrimSimpleC e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => InterpretPrimSimpleC e m a -> (e0 -> InterpretPrimSimpleC e m a) -> InterpretPrimSimpleC e m a #

MonadCatch m => MonadCatch (InterpretSimpleC e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => InterpretSimpleC e m a -> (e0 -> InterpretSimpleC e m a) -> InterpretSimpleC e m a #

MonadCatch m => MonadCatch (EmbedC m) Source # 
Instance details

Defined in Control.Effect.Embed

Methods

catch :: Exception e => EmbedC m a -> (e -> EmbedC m a) -> EmbedC m a #

MonadCatch m => MonadCatch (RunMC m) Source # 
Instance details

Defined in Control.Effect.Embed

Methods

catch :: Exception e => RunMC m a -> (e -> RunMC m a) -> RunMC m a #

(Monoid o, MonadCatch m) => MonadCatch (WriterLazyC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => WriterLazyC o m a -> (e -> WriterLazyC o m a) -> WriterLazyC o m a #

(Monoid o, MonadCatch m) => MonadCatch (ListenLazyC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => ListenLazyC o m a -> (e -> ListenLazyC o m a) -> ListenLazyC o m a #

(Monoid o, MonadCatch m) => MonadCatch (TellLazyC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => TellLazyC o m a -> (e -> TellLazyC o m a) -> TellLazyC o m a #

(Monoid o, MonadCatch m) => MonadCatch (WriterC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => WriterC o m a -> (e -> WriterC o m a) -> WriterC o m a #

(Monoid o, MonadCatch m) => MonadCatch (ListenC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => ListenC o m a -> (e -> ListenC o m a) -> ListenC o m a #

(Monoid o, MonadCatch m) => MonadCatch (TellC o m) Source # 
Instance details

Defined in Control.Effect.Internal.Writer

Methods

catch :: Exception e => TellC o m a -> (e -> TellC o m a) -> TellC o m a #

MonadCatch m => MonadCatch (UnliftC m) Source # 
Instance details

Defined in Control.Effect.Internal.Unlift

Methods

catch :: Exception e => UnliftC m a -> (e -> UnliftC m a) -> UnliftC m a #

MonadCatch m => MonadCatch (StateLazyC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

catch :: Exception e => StateLazyC s m a -> (e -> StateLazyC s m a) -> StateLazyC s m a #

MonadCatch m => MonadCatch (StateC s m) Source # 
Instance details

Defined in Control.Effect.Internal.State

Methods

catch :: Exception e => StateC s m a -> (e -> StateC s m a) -> StateC s m a #

MonadCatch m => MonadCatch (HoistC m) Source # 
Instance details

Defined in Control.Effect.Internal.Regional

Methods

catch :: Exception e => HoistC m a -> (e -> HoistC m a) -> HoistC m a #

MonadCatch m => MonadCatch (ReaderC i m) Source # 
Instance details

Defined in Control.Effect.Internal.Reader

Methods

catch :: Exception e => ReaderC i m a -> (e -> ReaderC i m a) -> ReaderC i m a #

MonadCatch m => MonadCatch (HoistOptionC m) Source # 
Instance details

Defined in Control.Effect.Internal.Optional

Methods

catch :: Exception e => HoistOptionC m a -> (e -> HoistOptionC m a) -> HoistOptionC m a #

MonadCatch m => MonadCatch (UnwrapTopC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

catch :: Exception e0 => UnwrapTopC e m a -> (e0 -> UnwrapTopC e m a) -> UnwrapTopC e m a #

MonadCatch m => MonadCatch (UnwrapC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

catch :: Exception e0 => UnwrapC e m a -> (e0 -> UnwrapC e m a) -> UnwrapC e m a #

MonadCatch m => MonadCatch (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

catch :: Exception e0 => ErrorC e m a -> (e0 -> ErrorC e m a) -> ErrorC e m a #

MonadCatch m => MonadCatch (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

catch :: Exception e0 => ThrowC e m a -> (e0 -> ThrowC e m a) -> ThrowC e m a #

MonadCatch m => MonadCatch (BaseControlC m) Source # 
Instance details

Defined in Control.Effect.Internal.BaseControl

Methods

catch :: Exception e => BaseControlC m a -> (e -> BaseControlC m a) -> BaseControlC m a #

MonadCatch m => MonadCatch (FreeT f m) Source # 
Instance details

Defined in Control.Monad.Trans.Free.Church.Alternate

Methods

catch :: Exception e => FreeT f m a -> (e -> FreeT f m a) -> FreeT f m a #

MonadCatch m => MonadCatch (ShiftC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

catch :: Exception e => ShiftC r m a -> (e -> ShiftC r m a) -> ShiftC r m a #

MonadCatch m => MonadCatch (ContC r m) Source # 
Instance details

Defined in Control.Effect.Internal.Cont

Methods

catch :: Exception e => ContC r m a -> (e -> ContC r m a) -> ContC r m a #

MonadCatch m => MonadCatch (SteppedC e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Stepped

Methods

catch :: Exception e0 => SteppedC e m a -> (e0 -> SteppedC e m a) -> SteppedC e m a #

MonadCatch m => MonadCatch (InterceptRC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Intercept

Methods

catch :: Exception e0 => InterceptRC e m a -> (e0 -> InterceptRC e m a) -> InterceptRC e m a #

MonadCatch m => MonadCatch (InterpretFailC h m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

catch :: Exception e => InterpretFailC h m a -> (e -> InterpretFailC h m a) -> InterpretFailC h m a #

MonadCatch m => MonadCatch (InterpretAltC h m) Source # 
Instance details

Defined in Control.Effect.Alt

Methods

catch :: Exception e => InterpretAltC h m a -> (e -> InterpretAltC h m a) -> InterpretAltC h m a #

MonadCatch m => MonadCatch (SubsumeC e m) Source # 
Instance details

Defined in Control.Effect.Internal

Methods

catch :: Exception e0 => SubsumeC e m a -> (e0 -> SubsumeC e m a) -> SubsumeC e m a #

MonadCatch m => MonadCatch (IntroC top new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Intro

Methods

catch :: Exception e => IntroC top new m a -> (e -> IntroC top new m a) -> IntroC top new m a #

MonadCatch m => MonadCatch (ReinterpretSimpleC e new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => ReinterpretSimpleC e new m a -> (e0 -> ReinterpretSimpleC e new m a) -> ReinterpretSimpleC e new m a #

MonadCatch m => MonadCatch (InterpretC h e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => InterpretC h e m a -> (e0 -> InterpretC h e m a) -> InterpretC h e m a #

MonadCatch m => MonadCatch (InterpretPrimC s e m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => InterpretPrimC s e m a -> (e0 -> InterpretPrimC s e m a) -> InterpretPrimC s e m a #

MonadCatch m => MonadCatch (UnionC l m) Source # 
Instance details

Defined in Control.Effect.Union

Methods

catch :: Exception e => UnionC l m a -> (e -> UnionC l m a) -> UnionC l m a #

MonadCatch m => MonadCatch (WrapC e e' m) Source # 
Instance details

Defined in Control.Effect.Internal.Newtype

Methods

catch :: Exception e0 => WrapC e e' m a -> (e0 -> WrapC e e' m a) -> WrapC e e' m a #

(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #

(MonadCatch m, Monoid w) => MonadCatch (RWST r w s m) 
Instance details

Defined in Control.Monad.Catch

Methods

catch :: Exception e => RWST r w s m a -> (e -> RWST r w s m a) -> RWST r w s m a #

MonadCatch (t (u m)) => MonadCatch (ComposeT t u m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Compose

Methods

catch :: Exception e => ComposeT t u m a -> (e -> ComposeT t u m a) -> ComposeT t u m a #

Monad m => MonadCatch (ViaAlg s Bracket m) Source # 
Instance details

Defined in Control.Effect.Type.Bracket

Methods

catch :: Exception e => ViaAlg s Bracket m a -> (e -> ViaAlg s Bracket m a) -> ViaAlg s Bracket m a #

Monad m => MonadCatch (ViaAlg s Mask m) Source # 
Instance details

Defined in Control.Effect.Type.Mask

Methods

catch :: Exception e => ViaAlg s Mask m a -> (e -> ViaAlg s Mask m a) -> ViaAlg s Mask m a #

MonadCatch m => MonadCatch (ReinterpretC h e new m) Source # 
Instance details

Defined in Control.Effect.Carrier.Internal.Interpret

Methods

catch :: Exception e0 => ReinterpretC h e new m a -> (e0 -> ReinterpretC h e new m a) -> ReinterpretC h e new m a #

MonadCatch m => MonadCatch (UnionizeC b m) Source # 
Instance details

Defined in Control.Effect.Union

Methods

catch :: Exception e => UnionizeC b m a -> (e -> UnionizeC b m a) -> UnionizeC b m a #

MonadCatch m => MonadCatch (ExceptionallyC eff exc m) Source # 
Instance details

Defined in Control.Effect.Exceptional

Methods

catch :: Exception e => ExceptionallyC eff exc m a -> (e -> ExceptionallyC eff exc m a) -> ExceptionallyC eff exc m a #

MonadCatch m => MonadCatch (GainBaseControlC b z m) Source # 
Instance details

Defined in Control.Effect.BaseControl

Methods

catch :: Exception e => GainBaseControlC b z m a -> (e -> GainBaseControlC b z m a) -> GainBaseControlC b z m a #

Carriers

data ThrowC e m a Source #

Instances

Instances details
MonadBase b m => MonadBase b (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

liftBase :: b α -> ThrowC e m α #

MonadBaseControl b m => MonadBaseControl b (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type StM (ThrowC e m) a #

Methods

liftBaseWith :: (RunInBase (ThrowC e m) b -> b a) -> ThrowC e m a #

restoreM :: StM (ThrowC e m) a -> ThrowC e m a #

MonadTrans (ThrowC e) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

lift :: Monad m => m a -> ThrowC e m a #

MonadTransControl (ThrowC e) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type StT (ThrowC e) a #

Methods

liftWith :: Monad m => (Run (ThrowC e) -> m a) -> ThrowC e m a #

restoreT :: Monad m => m (StT (ThrowC e) a) -> ThrowC e m a #

Monad m => Monad (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

(>>=) :: ThrowC e m a -> (a -> ThrowC e m b) -> ThrowC e m b #

(>>) :: ThrowC e m a -> ThrowC e m b -> ThrowC e m b #

return :: a -> ThrowC e m a #

Functor m => Functor (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

fmap :: (a -> b) -> ThrowC e m a -> ThrowC e m b #

(<$) :: a -> ThrowC e m b -> ThrowC e m a #

MonadFix m => MonadFix (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mfix :: (a -> ThrowC e m a) -> ThrowC e m a #

MonadFail m => MonadFail (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

fail :: String -> ThrowC e m a #

Monad m => Applicative (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

pure :: a -> ThrowC e m a #

(<*>) :: ThrowC e m (a -> b) -> ThrowC e m a -> ThrowC e m b #

liftA2 :: (a -> b -> c) -> ThrowC e m a -> ThrowC e m b -> ThrowC e m c #

(*>) :: ThrowC e m a -> ThrowC e m b -> ThrowC e m b #

(<*) :: ThrowC e m a -> ThrowC e m b -> ThrowC e m a #

MonadIO m => MonadIO (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

liftIO :: IO a -> ThrowC e m a #

(Monad m, Monoid e) => Alternative (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

empty :: ThrowC e m a #

(<|>) :: ThrowC e m a -> ThrowC e m a -> ThrowC e m a #

some :: ThrowC e m a -> ThrowC e m [a] #

many :: ThrowC e m a -> ThrowC e m [a] #

(Monad m, Monoid e) => MonadPlus (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mzero :: ThrowC e m a #

mplus :: ThrowC e m a -> ThrowC e m a -> ThrowC e m a #

MonadThrow m => MonadThrow (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

throwM :: Exception e0 => e0 -> ThrowC e m a #

MonadCatch m => MonadCatch (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

catch :: Exception e0 => ThrowC e m a -> (e0 -> ThrowC e m a) -> ThrowC e m a #

MonadMask m => MonadMask (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mask :: ((forall a. ThrowC e m a -> ThrowC e m a) -> ThrowC e m b) -> ThrowC e m b #

uninterruptibleMask :: ((forall a. ThrowC e m a -> ThrowC e m a) -> ThrowC e m b) -> ThrowC e m b #

generalBracket :: ThrowC e m a -> (a -> ExitCase b -> ThrowC e m c) -> (a -> ThrowC e m b) -> ThrowC e m (b, c) #

(Carrier m, Threads (ExceptT e) (Prims m)) => Carrier (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type Derivs (ThrowC e m) :: [Effect] Source #

type Prims (ThrowC e m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (ThrowC e m)) (ThrowC e m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (ThrowC e m)) (Prims (ThrowC e m)) (ThrowC e m) z a Source #

algDerivs :: Algebra' (Derivs (ThrowC e m)) (ThrowC e m) a Source #

type StT (ThrowC e) a Source # 
Instance details

Defined in Control.Effect.Internal.Error

type StT (ThrowC e) a = StT (ExceptT e) a
type Derivs (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

type Derivs (ThrowC e m) = Throw e ': Derivs m
type Prims (ThrowC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

type Prims (ThrowC e m) = Prims m
type StM (ThrowC e m) a Source # 
Instance details

Defined in Control.Effect.Internal.Error

type StM (ThrowC e m) a = StM (ExceptT e m) a

data ErrorC e m a Source #

Instances

Instances details
MonadBase b m => MonadBase b (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

liftBase :: b α -> ErrorC e m α #

MonadBaseControl b m => MonadBaseControl b (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type StM (ErrorC e m) a #

Methods

liftBaseWith :: (RunInBase (ErrorC e m) b -> b a) -> ErrorC e m a #

restoreM :: StM (ErrorC e m) a -> ErrorC e m a #

MonadTrans (ErrorC e) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

lift :: Monad m => m a -> ErrorC e m a #

MonadTransControl (ErrorC e) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type StT (ErrorC e) a #

Methods

liftWith :: Monad m => (Run (ErrorC e) -> m a) -> ErrorC e m a #

restoreT :: Monad m => m (StT (ErrorC e) a) -> ErrorC e m a #

Monad m => Monad (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

(>>=) :: ErrorC e m a -> (a -> ErrorC e m b) -> ErrorC e m b #

(>>) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m b #

return :: a -> ErrorC e m a #

Functor m => Functor (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

fmap :: (a -> b) -> ErrorC e m a -> ErrorC e m b #

(<$) :: a -> ErrorC e m b -> ErrorC e m a #

MonadFix m => MonadFix (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mfix :: (a -> ErrorC e m a) -> ErrorC e m a #

MonadFail m => MonadFail (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

fail :: String -> ErrorC e m a #

Monad m => Applicative (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

pure :: a -> ErrorC e m a #

(<*>) :: ErrorC e m (a -> b) -> ErrorC e m a -> ErrorC e m b #

liftA2 :: (a -> b -> c) -> ErrorC e m a -> ErrorC e m b -> ErrorC e m c #

(*>) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m b #

(<*) :: ErrorC e m a -> ErrorC e m b -> ErrorC e m a #

MonadIO m => MonadIO (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

liftIO :: IO a -> ErrorC e m a #

(Monad m, Monoid e) => Alternative (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

empty :: ErrorC e m a #

(<|>) :: ErrorC e m a -> ErrorC e m a -> ErrorC e m a #

some :: ErrorC e m a -> ErrorC e m [a] #

many :: ErrorC e m a -> ErrorC e m [a] #

(Monad m, Monoid e) => MonadPlus (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mzero :: ErrorC e m a #

mplus :: ErrorC e m a -> ErrorC e m a -> ErrorC e m a #

MonadThrow m => MonadThrow (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

throwM :: Exception e0 => e0 -> ErrorC e m a #

MonadCatch m => MonadCatch (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

catch :: Exception e0 => ErrorC e m a -> (e0 -> ErrorC e m a) -> ErrorC e m a #

MonadMask m => MonadMask (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

mask :: ((forall a. ErrorC e m a -> ErrorC e m a) -> ErrorC e m b) -> ErrorC e m b #

uninterruptibleMask :: ((forall a. ErrorC e m a -> ErrorC e m a) -> ErrorC e m b) -> ErrorC e m b #

generalBracket :: ErrorC e m a -> (a -> ExitCase b -> ErrorC e m c) -> (a -> ErrorC e m b) -> ErrorC e m (b, c) #

(Carrier m, Threads (ExceptT e) (Prims m)) => Carrier (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Associated Types

type Derivs (ErrorC e m) :: [Effect] Source #

type Prims (ErrorC e m) :: [Effect] Source #

Methods

algPrims :: Algebra' (Prims (ErrorC e m)) (ErrorC e m) a Source #

reformulate :: Monad z => Reformulation' (Derivs (ErrorC e m)) (Prims (ErrorC e m)) (ErrorC e m) z a Source #

algDerivs :: Algebra' (Derivs (ErrorC e m)) (ErrorC e m) a Source #

type StT (ErrorC e) a Source # 
Instance details

Defined in Control.Effect.Internal.Error

type StT (ErrorC e) a = StT (ExceptT e) a
type Derivs (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

type Derivs (ErrorC e m) = Catch e ': (Throw e ': Derivs m)
type Prims (ErrorC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

type Prims (ErrorC e m) = Optional ((->) e :: Type -> Type) ': Prims m
type StM (ErrorC e m) a Source # 
Instance details

Defined in Control.Effect.Internal.Error

type StM (ErrorC e m) a = StM (ExceptT e m) a

type ErrorToIOC e m a = forall s s'. ReifiesErrorHandler s s' e (ErrorIOToIOC m) => ErrorToIOC' s s' e m a Source #

type InterpretErrorC e m a = forall s s'. ReifiesErrorHandler s s' e m => InterpretErrorC' s s' e m a Source #

type InterpretErrorC' s s' smallExc = CompositionC '[InterpretC (ViaReifiedH s) (Catch smallExc), InterpretC (ViaReifiedH s') (Throw smallExc)] Source #