Several data-types like Either but with differing properties and type-class instances.
Library support is provided for those different representations, include
lens-related functions for converting between each and abstracting over their similarities.
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
As a consequence of this
Applicative instance, there is no corresponding
AccValidation is an example of, "An applicative
functor that is not a monad."
Validation data type is isomorphic to
Either and has a
that does the same as
Either. The only difference to
Either is the
constructor names and surrounding library support.
ValidationT data type is the monad transformer for
An instance of
MonadTrans is provided for
(ValidationT err). Due to the
arrangement of the
ValidationT type constructor, which permits a
MonadTrans instance, there is no possibleBifunctor
instance. Consequently, theValidationB
data type provides aBifunctor
instance (but not aMonadTrans
instance). Library support is provided to exploit the isomorphism toValidationB`.
Note that since
AccValidation is not a monad, there is also no corresponding
monad transformer for this data type.
ValidationB data type is similar to the monad transformer for
ValidationT), however, due to the arrangement of the
ValidationB type constructor, which permits a
Bifunctor instance, there is
MonadTrans instance. Consequently, the
ValidationT data type
MonadTrans instance (but not a
Library support is provided to exploit the isomorphism to
Validation' err a type-alias is equivalent to
ValidationT err Identity a and so is isomorphic to
Either and others. Libraries are supplied
|Package Version||Update ID||Released||Package Hub Version||Platforms||Subpackages|
|0.5.4-bp150.1.3 info||GA Release||2018-07-30||15||