Copyright | (c) Owen Shepherd 2021 |
---|---|
License | MIT |
Maintainer | owen@owen.cafe |
Stability | stable |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data MultiExcept err a
- fromEither :: Either err a -> MultiExcept err a
- fromEitherPoly :: Either (DNonEmpty err) a -> MultiExcept err a
- join :: MultiExcept err (MultiExcept err a) -> MultiExcept err a
- runMultiExcept :: MultiExcept err a -> Either (NonEmpty err) a
- succeed :: a -> MultiExcept err a
- throwError :: err -> MultiExcept err a
- throwErrors :: DNonEmpty err -> MultiExcept err a
Documentation
data MultiExcept err a Source #
A MultiExcept is a success value, or one or more errors.
Instances
fromEither :: Either err a -> MultiExcept err a Source #
Convert an Either
to a MultiExcept
.
fromEitherPoly :: Either (DNonEmpty err) a -> MultiExcept err a Source #
Convert a multi-error Either
to a MultiExcept
.
join :: MultiExcept err (MultiExcept err a) -> MultiExcept err a Source #
Join nested MultiExcept
s with the same error type.
Note that this doesn't imply a valid Monad
instance.
runMultiExcept :: MultiExcept err a -> Either (NonEmpty err) a Source #
Run the computation.
succeed :: a -> MultiExcept err a Source #
Embeds a value into a MultiExcept
context.
throwError :: err -> MultiExcept err a Source #
Throw a single error.
throwErrors :: DNonEmpty err -> MultiExcept err a Source #
Throw one or more errors.