Copyright | (c) Owen Shepherd 2021 |
---|---|
License | MIT |
Maintainer | owen@owen.cafe |
Stability | stable |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data MultiExcept err a
- fromEither :: Either err a -> MultiExcept err a
- fromEitherPoly :: Either (NonEmptyDList err) a -> MultiExcept err a
- join :: MultiExcept err (MultiExcept err a) -> MultiExcept err a
- runMultiExcept :: MultiExcept err a -> Either (NonEmptyDList err) a
- succeed :: forall err a. a -> MultiExcept err a
- throwError :: forall a err. err -> MultiExcept err a
- throwErrors :: forall a err. NonEmptyDList 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 (NonEmptyDList 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 useful Monad
instance.
The instance defined in terms of join discards errors on the RHS of >>=
.
runMultiExcept :: MultiExcept err a -> Either (NonEmptyDList err) a Source #
Run the computation.
succeed :: forall err a. a -> MultiExcept err a Source #
Embeds a value into a MultiExcept
context.
throwError :: forall a err. err -> MultiExcept err a Source #
Throw a single error.
throwErrors :: forall a err. NonEmptyDList err -> MultiExcept err a Source #
Throw one or more errors.