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

Control.Effect.ErrorIO

Synopsis

Effects

data ErrorIO (m :: Type -> Type) a where Source #

An effect for throwing and catching IO-based exceptions.

Constructors

ThrowIO :: Exception e => e -> ErrorIO m a 
CatchIO :: Exception e => m a -> (e -> m a) -> ErrorIO m a 

Instances

Instances details
(MonadThrow m, Eff (Optional ((->) SomeException :: Type -> Type)) m) => Handler ErrorIOFinalH ErrorIO m Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

class (Typeable e, Show e) => Exception e where #

Any type that you wish to throw or catch as an exception must be an instance of the Exception class. The simplest case is a new exception type directly below the root:

data MyException = ThisException | ThatException
    deriving Show

instance Exception MyException

The default method definitions in the Exception class do what we need in this case. You can now throw and catch ThisException and ThatException as exceptions:

*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException

In more complicated examples, you may wish to define a whole hierarchy of exceptions:

---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler

data SomeCompilerException = forall e . Exception e => SomeCompilerException e

instance Show SomeCompilerException where
    show (SomeCompilerException e) = show e

instance Exception SomeCompilerException

compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException

compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
    SomeCompilerException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler

data SomeFrontendException = forall e . Exception e => SomeFrontendException e

instance Show SomeFrontendException where
    show (SomeFrontendException e) = show e

instance Exception SomeFrontendException where
    toException = compilerExceptionToException
    fromException = compilerExceptionFromException

frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException

frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
    SomeFrontendException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception

data MismatchedParentheses = MismatchedParentheses
    deriving Show

instance Exception MismatchedParentheses where
    toException   = frontendExceptionToException
    fromException = frontendExceptionFromException

We can now catch a MismatchedParentheses exception as MismatchedParentheses, SomeFrontendException or SomeCompilerException, but not other types, e.g. IOException:

*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses

Minimal complete definition

Nothing

Methods

toException :: e -> SomeException #

fromException :: SomeException -> Maybe e #

displayException :: e -> String #

Render this exception value in a human-friendly manner.

Default implementation: show.

Since: base-4.8.0.0

Instances

Instances details
Exception AsyncCancelled 
Instance details

Defined in Control.Concurrent.Async

Exception ExceptionInLinkedThread 
Instance details

Defined in Control.Concurrent.Async

Exception Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Exception PatternMatchFail

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecSelError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecConError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception RecUpdError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception NoMethodError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception TypeError

Since: base-4.9.0.0

Instance details

Defined in Control.Exception.Base

Exception NonTermination

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception NestedAtomically

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Exception BlockedIndefinitelyOnMVar

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception BlockedIndefinitelyOnSTM

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception Deadlock

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception AllocationLimitExceeded

Since: base-4.8.0.0

Instance details

Defined in GHC.IO.Exception

Exception CompactionFailed

Since: base-4.10.0.0

Instance details

Defined in GHC.IO.Exception

Exception AssertionFailed

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception SomeAsyncException

Since: base-4.7.0.0

Instance details

Defined in GHC.IO.Exception

Exception AsyncException

Since: base-4.7.0.0

Instance details

Defined in GHC.IO.Exception

Exception ArrayException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception FixIOException

Since: base-4.11.0.0

Instance details

Defined in GHC.IO.Exception

Exception ExitCode

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception IOException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Exception ErrorCall

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception

Exception ArithException

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception.Type

Exception SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Exception OpaqueExc Source # 
Instance details

Defined in Control.Effect.Internal.Error

data SomeException #

The SomeException type is the root of the exception type hierarchy. When an exception of type e is thrown, behind the scenes it is encapsulated in a SomeException.

Actions

throwIO :: (Exception e, Eff ErrorIO m) => e -> m a Source #

catchIO :: (Exception e, Eff ErrorIO m) => m a -> (e -> m a) -> m a Source #

Interpretations

errorIOToIO :: (Carrier m, MonadCatch m) => ErrorIOToIOC m a -> m a Source #

Run an ErrorIO effect by making use of IO exceptions.

Derivs (ErrorIOToIOC e m) = ErrorIO ': Derivs m
Prims (ErrorIOToIOC e m) = Optional ((->) SomeException) ': Prims m

errorIOToError :: Eff (Error SomeException) m => ErrorIOToErrorC m a -> m a Source #

Transform an ErrorIO effect into an Error SomeException effect.

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 (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

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

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

Defined in Control.Effect.Internal.Conc

Methods

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

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

Defined in Control.Effect.Trace

Methods

catch :: Exception e => TraceListC m a -> (e -> TraceListC m a) -> TraceListC 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 (FailC m) Source # 
Instance details

Defined in Control.Effect.Fail

Methods

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

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

Defined in Control.Effect.Alt

Methods

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

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 (ErrorToIOSimpleC e m) Source # 
Instance details

Defined in Control.Effect.Internal.Error

Methods

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

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

Defined in Control.Effect.Internal.Error

Methods

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

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

Defined in Control.Effect.Internal.Error

Methods

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

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

Defined in Control.Effect.Internal.Error

Methods

catch :: Exception e0 => ErrorToErrorIOAsExcC e m a -> (e0 -> ErrorToErrorIOAsExcC e m a) -> ErrorToErrorIOAsExcC 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 (SafeErrorToErrorIOSimpleC exc m) Source # 
Instance details

Defined in Control.Effect.Internal.Exceptional

MonadCatch m => MonadCatch (SafeErrorToIOSimpleC exc m) Source # 
Instance details

Defined in Control.Effect.Internal.Exceptional

Methods

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

MonadCatch m => MonadCatch (SafeErrorC exc m) Source # 
Instance details

Defined in Control.Effect.Internal.Exceptional

Methods

catch :: Exception e => SafeErrorC exc m a -> (e -> SafeErrorC exc m a) -> SafeErrorC exc 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 (FreshEnumC uniq m) Source # 
Instance details

Defined in Control.Effect.Fresh

Methods

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

MonadCatch m => MonadCatch (WriterTVarC o m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

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

MonadCatch m => MonadCatch (ListenTVarC o m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

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

MonadCatch m => MonadCatch (WriterToBracketC o m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

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

MonadCatch m => MonadCatch (WriterIntoEndoWriterC o m) Source # 
Instance details

Defined in Control.Effect.Writer

MonadCatch m => MonadCatch (ListenIntoEndoListenC o m) Source # 
Instance details

Defined in Control.Effect.Writer

MonadCatch m => MonadCatch (TellListLazyC o m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

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

MonadCatch m => MonadCatch (TellListC o m) Source # 
Instance details

Defined in Control.Effect.Writer

Methods

catch :: Exception e => TellListC o m a -> (e -> TellListC o m a) -> TellListC o 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 (ListenSteppedC w m) Source # 
Instance details

Defined in Control.Effect.Internal.Intercept

Methods

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

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

Defined in Control.Effect.Internal.Intercept

Methods

catch :: Exception e0 => InterceptContC e m a -> (e0 -> InterceptContC e m a) -> InterceptContC 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 => MonadCatch (SelectC s r m) Source # 
Instance details

Defined in Control.Effect.Internal.Select

Methods

catch :: Exception e => SelectC s r m a -> (e -> SelectC s r m a) -> SelectC s r 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 (UnionizeHeadC b m) Source # 
Instance details

Defined in Control.Effect.Union

Methods

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

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

Defined in Control.Effect.Internal.Error

Methods

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

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

Defined in Control.Effect.Internal.Error

Methods

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

MonadCatch m => MonadCatch (SafeErrorToErrorIOC' s s' exc m) Source # 
Instance details

Defined in Control.Effect.Internal.Exceptional

Methods

catch :: Exception e => SafeErrorToErrorIOC' s s' exc m a -> (e -> SafeErrorToErrorIOC' s s' exc m a) -> SafeErrorToErrorIOC' s s' exc m a #

MonadCatch m => MonadCatch (SafeErrorToIOC' s s' exc m) Source # 
Instance details

Defined in Control.Effect.Internal.Exceptional

Methods

catch :: Exception e => SafeErrorToIOC' s s' exc m a -> (e -> SafeErrorToIOC' s s' exc m a) -> SafeErrorToIOC' s s' exc m a #

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

Defined in Control.Effect.Internal.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 ErrorIOToIOC m a Source #

Instances

Instances details
MonadTrans ErrorIOToIOC Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

lift :: Monad m => m a -> ErrorIOToIOC m a #

MonadTransControl ErrorIOToIOC Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Associated Types

type StT ErrorIOToIOC a #

Methods

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

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

MonadBase b m => MonadBase b (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

liftBase :: b α -> ErrorIOToIOC m α #

MonadBaseControl b m => MonadBaseControl b (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Associated Types

type StM (ErrorIOToIOC m) a #

Methods

liftBaseWith :: (RunInBase (ErrorIOToIOC m) b -> b a) -> ErrorIOToIOC m a #

restoreM :: StM (ErrorIOToIOC m) a -> ErrorIOToIOC m a #

Monad m => Monad (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

(>>=) :: ErrorIOToIOC m a -> (a -> ErrorIOToIOC m b) -> ErrorIOToIOC m b #

(>>) :: ErrorIOToIOC m a -> ErrorIOToIOC m b -> ErrorIOToIOC m b #

return :: a -> ErrorIOToIOC m a #

Functor m => Functor (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

fmap :: (a -> b) -> ErrorIOToIOC m a -> ErrorIOToIOC m b #

(<$) :: a -> ErrorIOToIOC m b -> ErrorIOToIOC m a #

MonadFix m => MonadFix (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

mfix :: (a -> ErrorIOToIOC m a) -> ErrorIOToIOC m a #

MonadFail m => MonadFail (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

fail :: String -> ErrorIOToIOC m a #

Applicative m => Applicative (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

pure :: a -> ErrorIOToIOC m a #

(<*>) :: ErrorIOToIOC m (a -> b) -> ErrorIOToIOC m a -> ErrorIOToIOC m b #

liftA2 :: (a -> b -> c) -> ErrorIOToIOC m a -> ErrorIOToIOC m b -> ErrorIOToIOC m c #

(*>) :: ErrorIOToIOC m a -> ErrorIOToIOC m b -> ErrorIOToIOC m b #

(<*) :: ErrorIOToIOC m a -> ErrorIOToIOC m b -> ErrorIOToIOC m a #

MonadIO m => MonadIO (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

liftIO :: IO a -> ErrorIOToIOC m a #

Alternative m => Alternative (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

empty :: ErrorIOToIOC m a #

(<|>) :: ErrorIOToIOC m a -> ErrorIOToIOC m a -> ErrorIOToIOC m a #

some :: ErrorIOToIOC m a -> ErrorIOToIOC m [a] #

many :: ErrorIOToIOC m a -> ErrorIOToIOC m [a] #

MonadPlus m => MonadPlus (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

mzero :: ErrorIOToIOC m a #

mplus :: ErrorIOToIOC m a -> ErrorIOToIOC m a -> ErrorIOToIOC m a #

MonadThrow m => MonadThrow (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

throwM :: Exception e => e -> ErrorIOToIOC m a #

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

Defined in Control.Effect.Internal.ErrorIO

Methods

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

MonadMask m => MonadMask (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Methods

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

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

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

(Carrier m, MonadCatch m) => Carrier (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

Associated Types

type Derivs (ErrorIOToIOC m) :: [Effect] Source #

type Prims (ErrorIOToIOC m) :: [Effect] Source #

type StT ErrorIOToIOC a Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

type Derivs (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

type Prims (ErrorIOToIOC m) Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

type StM (ErrorIOToIOC m) a Source # 
Instance details

Defined in Control.Effect.Internal.ErrorIO

type ErrorIOToErrorC = InterpretC ErrorIOToErrorH ErrorIO Source #