Safe Haskell | None |
---|---|
Language | Haskell2010 |
Add-ons to Exception
- try :: forall e r a. Member (Exc e) r => Eff r a -> Eff r (Either e a)
- 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
- runErrorRethrowIO :: forall e r a. (Exception e, SetMember Lift (Lift IO) r) => Eff (Exc e ': r) a -> Eff r a
- liftCatch :: forall e r a. (HasCallStack, Exception e, SetMember Lift (Lift IO) r) => (e -> a) -> IO a -> Eff r a
- liftCatchEff :: forall e r a. (SetMember Lift (Lift IO) r, HasCallStack, Exception e) => (e -> Eff r a) -> IO a -> Eff r a
- liftTry :: forall e r a. (HasCallStack, Exception e, SetMember Lift (Lift IO) r) => Eff r a -> Eff r (Either e a)
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.