extensible-effects-concurrent-0.2.0.2: Message passing concurrency as extensible-effect

Safe HaskellNone
LanguageHaskell2010

Control.Eff.ExceptionExtra

Description

Add-ons to Exception

Synopsis

Documentation

try :: forall e r a. Member (Exc e) r => Eff r a -> Eff r (Either e a) Source #

Catch an exception and return it in an Either.

liftRethrow :: forall proxy e r a. (Exception e, SetMember Lift (Lift IO) r, SetMember Exc (Exc e) r) => proxy e -> IO a -> Eff r a Source #

Lift an IO action and catch all error using try then wrap the Exception using a given wrapper function and rethrow it using throwError.

runErrorRethrowIO :: forall e r a. (Exception e, SetMember Lift (Lift IO) r) => Eff (Exc e ': r) a -> Eff r a Source #

Run an effect with exceptions like runError and rethrow it as SomeException using throw

liftCatch :: forall e r a. (HasCallStack, Exception e, SetMember Lift (Lift IO) r) => (e -> a) -> IO a -> Eff r a Source #

Lift an IO action and catch all errors with try with a pure handler.

liftCatchEff :: forall e r a. (SetMember Lift (Lift IO) r, HasCallStack, Exception e) => (e -> Eff r a) -> IO a -> Eff r a Source #

Lift an IO action and catch all errors with try with an effect handler.

liftTry :: forall e r a. (HasCallStack, Exception e, SetMember Lift (Lift IO) r) => Eff r a -> Eff r (Either e a) Source #

Catch Exception thrown by an effect.