Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Either, but with an Applicative instance that combines errors via <>
.
This is sometimes known as the validation Applicative. There are Haskell packages providing this type, however, in the interest of minimized dependency footprint we use this.
Documentation
newtype AccumE err val Source #
A version of Either that accumulates errors via an instance of Semigroup
.
This is sometimes called the validation applicative.
pattern AccumEL :: err -> AccumE err val | Construct an error value. |
pattern AccumER :: val -> AccumE err val | Construct a good value.
Equivalent to |
Instances
Bifunctor AccumE Source # | |
Functor (AccumE err) Source # | |
Semigroup e => Applicative (AccumE e) Source # | Applicative accumulates errors. Note that this is *strict* in the error, because this can sometimes reduce the number of allocations in the places where we use this. |
Monoid m => Alternative (AccumE m) Source # | Alternative takes the first result if there is a result. If there is not, will *not* accumulate errors. |
(Read a, Read b) => Read (AccumE a b) Source # | Read instance uses the |
(Show a, Show b) => Show (AccumE a b) Source # | Show instance uses the |
Generic (AccumE err val) Source # | |
Semigroup e => Semigroup (AccumE e a) Source # | Semigroup accumulates errors if both are errors, otherwise it returns the first good value. |
Monoid err => Monoid (AccumE err a) Source # | |
type Rep (AccumE err val) Source # | |
Defined in Jordan.Types.Internal.AccumE |