incipit-core-0.4.0.0: A Prelude for Polysemy
Safe HaskellSafe-Inferred
LanguageHaskell2010

Incipit.Exception

Description

Combinators that catch exceptions in IO and embed them into Sem.

Synopsis

Documentation

tryIOE :: forall e r a. Exception e => Member (Embed IO) r => IO a -> Sem r (Either e a) Source #

Run an IO via Embed and catch exceptions of type e, returning Either. Unlike all other combinators, this doesn't convert the exception to Text.

tryIO :: forall e r a. Exception e => Member (Embed IO) r => IO a -> Sem r (Either Text a) Source #

Run an IO via Embed and catch exceptions of type e, returning Either.

tryIOError :: forall r a. Member (Embed IO) r => IO a -> Sem r (Either Text a) Source #

Run an IO via Embed and catch IOError, returning Either.

tryAny :: forall r a. Member (Embed IO) r => IO a -> Sem r (Either Text a) Source #

Run an IO via Embed and catch all exceptions, returning Either.

tryIOMaybe :: forall e r a. Exception e => Member (Embed IO) r => IO a -> Sem r (Maybe a) Source #

Run an IO via Embed and catch exceptions of type e, returning Maybe.

tryIOErrorMaybe :: forall r a. Member (Embed IO) r => IO a -> Sem r (Maybe a) Source #

Run an IO via Embed and catch IOError, returning Maybe.

tryMaybe :: forall r a. Member (Embed IO) r => IO a -> Sem r (Maybe a) Source #

Run an IO via Embed and catch all exceptions, returning Maybe.

tryIO_ :: forall e r. Exception e => Member (Embed IO) r => IO () -> Sem r () Source #

Run an IO via Embed and catch and ignore exceptions of type e.

tryIOError_ :: forall r. Member (Embed IO) r => IO () -> Sem r () Source #

Run an IO via Embed and catch and ignore IOError.

tryAny_ :: forall r. Member (Embed IO) r => IO () -> Sem r () Source #

Run an IO via Embed and catch and ignore all exceptions.

ignoreException :: Member (Embed IO) r => IO () -> Sem r () Source #

Deprecated: renamed to tryAny_

Run an IO via Embed and catch and ignore all exceptions.