polysemy-resume-0.8.0.1: Polysemy error tracking
Safe HaskellSafe-Inferred
LanguageGHC2021

Polysemy.Resume.Interpreter.Stop

Description

 
Synopsis

Documentation

runStop :: Sem (Stop err : r) a -> Sem r (Either err a) Source #

Equivalent of runError.

newtype StopExc err Source #

Internal type used to tag exceptions thrown by Stop interpreters.

Constructors

StopExc 

Fields

runStopAsExcFinal :: forall err r a. Exception (StopExc err) => Member (Final IO) r => Sem (Stop err : r) a -> Sem r a Source #

Run Stop by throwing exceptions.

stopToIOFinal :: forall err r a. Exception (StopExc err) => Member (Final IO) r => Sem (Stop err : r) a -> Sem r (Either err a) Source #

Run Stop by throwing and catching exceptions.

stopEitherWith :: forall err err' r a. Member (Stop err') r => (err -> err') -> Either err a -> Sem r a Source #

Stop if the argument is Left, transforming the error with f.

stopEitherAs :: forall err err' r a. Member (Stop err') r => err' -> Either err a -> Sem r a Source #

Stop if the argument is Left, using the supplied error.

stopEither :: forall err r a. Member (Stop err) r => Either err a -> Sem r a Source #

Stop if the argument is Left.

stopNote :: forall err r a. Member (Stop err) r => err -> Maybe a -> Sem r a Source #

Stop with the supplied error if the argument is Nothing.

stopOnError :: forall err r a. Member (Stop err) r => Sem (Error err : r) a -> Sem r a Source #

Convert a program using regular Errors to one using Stop.

stopOnErrorWith :: forall err err' r a. Member (Stop err') r => (err -> err') -> Sem (Error err : r) a -> Sem r a Source #

Convert a program using regular Errors to one using Stop.

stopToErrorWith :: forall err err' r a. Member (Error err') r => (err -> err') -> Sem (Stop err : r) a -> Sem r a Source #

Convert a program using Stop to one using Error, transforming the error with the supplied function.

stopToError :: forall err r a. Member (Error err) r => Sem (Stop err : r) a -> Sem r a Source #

Convert a program using Stop to one using Error.

stopToErrorIO :: forall err r a. Exception (StopExc err) => Members [Error err, Final IO] r => Sem (Stop err : r) a -> Sem r a Source #

Convert a program using Stop to one using Error.

mapStop :: forall err e' r a. Member (Stop e') r => (err -> e') -> Sem (Stop err : r) a -> Sem r a Source #

Map over the error type in a Stop.

replaceStop :: forall err e' r a. Member (Stop e') r => e' -> Sem (Stop err : r) a -> Sem r a Source #

Replace the error in a Stop with another type.

showStop :: forall err r a. Show err => Member (Stop Text) r => Sem (Stop err : r) a -> Sem r a Source #

Convert the error type in a Stop to Text.

stopTryIOE :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (exc -> err) -> IO a -> Sem r a Source #

Convert an IO exception to Stop using the provided transformation.

stopTryIO :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a Source #

Convert an IO exception of type err to Stop using the provided transformation from Text.

stopTryIOError :: forall err r a. Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a Source #

Convert an IO exception of type IOError to Stop using the provided transformation from Text.

stopTryAny :: forall err r a. Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a Source #

Convert an IO exception to Stop using the provided transformation from Text.