This effect abstracts the throwing and catching of errors, leaving it up to the interpreter whether to use exceptions or monad transformers like ExceptT to perform the short-circuiting mechanism.
Modulepolysemy-1.9.2.0Haskell2010
Polysemy.Error
Contents
Synopsis
- data Error
- value throw
- value catch
- value fromEither
- value fromEitherM
- value fromException
- value fromExceptionVia
- value fromExceptionSem
- value fromExceptionSemVia
- value note
- value try
- value tryJust
- value catchJust
- value runError
- value mapError
- value errorToIOFinal
- Packagepolysemy-1.9.2.0
- Exports16
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceError.hs
Effect
Actions
Short-circuit the current program using the given error value.
Recover from an error that might have been thrown in the higher-order action given by the first argument by passing the error to the handler given by the second argument.
A combinator doing embed and fromEither at the same time. Useful for interoperating with IO.
Like fromException, but with the ability to transform the exception before turning it into an Error.
Like fromExceptionSem, but with the ability to transform the exception before turning it into an Error.
value
catchJust Interpretations
Transform one Error into another. This function can be used to aggregate multiple errors into a single type.