Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- hush :: Either e a -> Maybe a
- runStop :: Sem (Stop e ': r) a -> Sem r (Either e a)
- newtype StopExc e = StopExc {
- unStopExc :: e
- runStopAsExcFinal :: Exception (StopExc e) => Member (Final IO) r => Sem (Stop e ': r) a -> Sem r a
- stopToIOFinal :: Exception (StopExc e) => Member (Final IO) r => Sem (Stop e ': r) a -> Sem r (Either e a)
- stopEitherWith :: Member (Stop err') r => (err -> err') -> Either err a -> Sem r a
- stopEither :: Member (Stop err) r => Either err a -> Sem r a
- stopNote :: Member (Stop err) r => err -> Maybe a -> Sem r a
- stopOnError :: Member (Stop err) r => Sem (Error err ': r) a -> Sem r a
- stopOnErrorWith :: Member (Stop err') r => (err -> err') -> Sem (Error err ': r) a -> Sem r a
- stopToError :: Member (Error err) r => Sem (Stop err ': r) a -> Sem r a
- stopToErrorIO :: Exception (StopExc err) => Members [Error err, Final IO] r => Sem (Stop err ': r) a -> Sem r a
- mapStop :: forall e e' r a. Member (Stop e') r => (e -> e') -> Sem (Stop e ': r) a -> Sem r a
- showStop :: forall e r a. Show e => Member (Stop Text) r => Sem (Stop e ': r) a -> Sem r a
Documentation
Instances
Typeable e => Show (StopExc e) Source # | |
Show (StopExc Text) Source # | |
Typeable e => Exception (StopExc e) Source # | |
Defined in Polysemy.Resume.Stop toException :: StopExc e -> SomeException # fromException :: SomeException -> Maybe (StopExc e) # displayException :: StopExc e -> String # | |
Exception (StopExc Text) Source # | |
Defined in Polysemy.Resume.Stop toException :: StopExc Text -> SomeException # fromException :: SomeException -> Maybe (StopExc Text) # displayException :: StopExc Text -> String # |
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
.
stopNote :: Member (Stop err) r => err -> Maybe a -> Sem r a Source #
Stop with the supplied error if the argument is Nothing
.
stopOnErrorWith :: Member (Stop err') r => (err -> err') -> Sem (Error err ': r) a -> Sem r a Source #
stopToErrorIO :: Exception (StopExc err) => Members [Error err, Final IO] r => Sem (Stop err ': r) a -> Sem r a Source #