Safe Haskell | Safe-Inferred |
---|---|
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
- stopEitherAs :: Member (Stop err') r => 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
- stopToErrorWith :: Member (Error err') r => (err -> err') -> Sem (Stop 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
- stopTryIOE :: forall exc e r a. Exception exc => Members [Stop e, Embed IO] r => (exc -> e) -> IO a -> Sem r a
- stopTryIO :: forall exc e r a. Exception exc => Members [Stop e, Embed IO] r => (Text -> e) -> IO a -> Sem r a
- stopTryIOError :: forall e r a. Members [Stop e, Embed IO] r => (Text -> e) -> IO a -> Sem r a
- stopTryAny :: forall e r a. Members [Stop e, Embed IO] r => (Text -> e) -> IO a -> Sem r a
Documentation
Instances
Exception (StopExc Text) Source # | |
Defined in Polysemy.Resume.Stop toException :: StopExc Text -> SomeException # fromException :: SomeException -> Maybe (StopExc Text) # displayException :: StopExc Text -> String # | |
Typeable e => Exception (StopExc e) Source # | |
Defined in Polysemy.Resume.Stop toException :: StopExc e -> SomeException # fromException :: SomeException -> Maybe (StopExc e) # displayException :: StopExc e -> String # | |
Show (StopExc Text) Source # | |
Typeable e => Show (StopExc e) Source # | |
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.
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 #
stopToErrorWith :: Member (Error err') r => (err -> err') -> Sem (Stop 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 #
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
.
stopTryIOE :: forall exc e r a. Exception exc => Members [Stop e, Embed IO] r => (exc -> e) -> IO a -> Sem r a Source #
stopTryIO :: forall exc e r a. Exception exc => Members [Stop e, Embed IO] r => (Text -> e) -> IO a -> Sem r a Source #