polysemy-resume-0.5.0.0: Polysemy error tracking
Safe HaskellSafe-Inferred
LanguageHaskell2010

Polysemy.Resume.Stop

Synopsis

Documentation

hush :: Either e a -> Maybe a Source #

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

Equivalent of runError.

newtype StopExc e Source #

Constructors

StopExc 

Fields

Instances

Instances details
Exception (StopExc Text) Source # 
Instance details

Defined in Polysemy.Resume.Stop

Typeable e => Exception (StopExc e) Source # 
Instance details

Defined in Polysemy.Resume.Stop

Show (StopExc Text) Source # 
Instance details

Defined in Polysemy.Resume.Stop

Typeable e => Show (StopExc e) Source # 
Instance details

Defined in Polysemy.Resume.Stop

Methods

showsPrec :: Int -> StopExc e -> ShowS #

show :: StopExc e -> String #

showList :: [StopExc e] -> ShowS #

runStopAsExcFinal :: Exception (StopExc e) => Member (Final IO) r => Sem (Stop e ': r) a -> Sem r a Source #

stopToIOFinal :: Exception (StopExc e) => Member (Final IO) r => Sem (Stop e ': r) a -> Sem r (Either e a) Source #

Run Stop by throwing exceptions.

stopEitherWith :: 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 :: Member (Stop err') r => err' -> Either err a -> Sem r a Source #

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

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

Stop if the argument is Left.

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

Stop with the supplied error if the argument is Nothing.

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

Convert a program using regular Errors to one using Stop.

stopOnErrorWith :: 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 :: 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 :: Member (Error err) r => Sem (Stop err ': r) a -> Sem r a Source #

Convert a program using Stop to one using Error.

stopToErrorIO :: 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 e e' r a. Member (Stop e') r => (e -> e') -> Sem (Stop e ': r) a -> Sem r a Source #

Map over the error type in a Stop.

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

Convert the error type in a Stop to Text.

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

Convert an IO exception to Stop using the provided transformation.

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

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

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

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

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

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