hw-polysemy-0.2.14.4: Opinionated polysemy library
Safe HaskellSafe-Inferred
LanguageHaskell2010

HaskellWorks.Polysemy.Error

Synopsis

Documentation

trap :: forall e r a. (e -> Sem r a) -> Sem (Error e ': r) a -> Sem r a Source #

Run a computation that may fail, and handle the error case. Unlike catch from Error this function removes the Error effect from the stack.

trap_ :: forall e r a. Sem r a -> Sem (Error e ': r) a -> Sem r a Source #

Like trap, but the error is not passed to the handler.

embedRunExceptT :: Member (Embed m) r => ExceptT e m a -> Sem r (Either e a) Source #

embedThrowExceptT :: Member (Error e) r => Member (Embed m) r => ExceptT e m a -> Sem r a Source #

Run an embedded ExceptT effect in a Sem monad and throw any errors.