validation-0.6.0: A data-type like Either but with an accumulating Applicative
A data-type like Either but with differing properties and type-class instances.
Library support is provided for this different representation, include
lens
-related functions for converting between each and abstracting over their
similarities.
AccValidation
The AccValidation
data type is isomorphic to Either
, but has an instance
of Applicative
that accumulates on the error side. That is to say, if two
(or more) errors are encountered, they are appended using a Semigroup
operation.
As a consequence of this Applicative
instance, there is no corresponding
Bind
or Monad
instance. AccValidation
is an example of, "An applicative
functor that is not a monad."
- Data