Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- runStop :: Sem (Stop err ': r) a -> Sem r (Either err a)
- newtype StopExc err = StopExc {
- unStopExc :: err
- runStopAsExcFinal :: forall err r a. Exception (StopExc err) => Member (Final IO) r => Sem (Stop err ': r) a -> Sem r a
- stopToIOFinal :: forall err r a. Exception (StopExc err) => Member (Final IO) r => Sem (Stop err ': r) a -> Sem r (Either err a)
- stopEitherWith :: forall err err' r a. Member (Stop err') r => (err -> err') -> Either err a -> Sem r a
- stopEitherAs :: forall err err' r a. Member (Stop err') r => err' -> Either err a -> Sem r a
- stopEither :: forall err r a. Member (Stop err) r => Either err a -> Sem r a
- stopNote :: forall err r a. Member (Stop err) r => err -> Maybe a -> Sem r a
- stopOnError :: forall err r a. Member (Stop err) r => Sem (Error err ': r) a -> Sem r a
- stopOnErrorWith :: forall err err' r a. Member (Stop err') r => (err -> err') -> Sem (Error err ': r) a -> Sem r a
- stopToErrorWith :: forall err err' r a. Member (Error err') r => (err -> err') -> Sem (Stop err ': r) a -> Sem r a
- stopToError :: forall err r a. Member (Error err) r => Sem (Stop err ': r) a -> Sem r a
- stopToErrorIO :: forall err r a. Exception (StopExc err) => Members [Error err, Final IO] r => Sem (Stop err ': r) a -> Sem r a
- mapStop :: forall err e' r a. Member (Stop e') r => (err -> e') -> Sem (Stop err ': r) a -> Sem r a
- replaceStop :: forall err e' r a. Member (Stop e') r => e' -> Sem (Stop err ': r) a -> Sem r a
- showStop :: forall err r a. Show err => Member (Stop Text) r => Sem (Stop err ': r) a -> Sem r a
- stopTryIOE :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (exc -> err) -> IO a -> Sem r a
- stopTryIO :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a
- stopTryIOError :: forall err r a. Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a
- stopTryAny :: forall err r a. Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a
Documentation
Internal type used to tag exceptions thrown by Stop
interpreters.
Instances
Exception (StopExc Text) Source # | |
Defined in Polysemy.Resume.Interpreter.Stop toException :: StopExc Text -> SomeException # fromException :: SomeException -> Maybe (StopExc Text) # displayException :: StopExc Text -> String # | |
Typeable err => Exception (StopExc err) Source # | |
Defined in Polysemy.Resume.Interpreter.Stop toException :: StopExc err -> SomeException # fromException :: SomeException -> Maybe (StopExc err) # displayException :: StopExc err -> String # | |
Show (StopExc Text) Source # | |
Typeable err => Show (StopExc err) Source # | |
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
.
stopOnErrorWith :: forall err err' r a. Member (Stop err') r => (err -> err') -> Sem (Error err ': r) a -> Sem r a Source #
stopToErrorWith :: forall err err' r a. Member (Error err') r => (err -> err') -> Sem (Stop err ': r) a -> Sem r a Source #
stopToErrorIO :: forall err r a. Exception (StopExc err) => Members [Error err, Final IO] r => Sem (Stop err ': r) a -> Sem r a Source #
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 #
stopTryIOE :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (exc -> err) -> IO a -> Sem r a Source #
stopTryIO :: forall exc err r a. Exception exc => Members [Stop err, Embed IO] r => (Text -> err) -> IO a -> Sem r a Source #