polysemy-resume-0.1.0.2: Polysemy error tracking
Safe HaskellNone
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
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 #

Show (StopExc Text) Source # 
Instance details

Defined in Polysemy.Resume.Stop

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

Defined in Polysemy.Resume.Stop

Exception (StopExc Text) Source # 
Instance details

Defined in Polysemy.Resume.Stop

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.

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.

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.