From the documentation of the validation
package:
The
AccValidation
data type is isomorphic toEither
, but has an instance ofApplicative
that accumulates on the error side. That is to say, if two (or more) errors are encountered, they are appended using aSemigroup
operation.As a consequence of this
Applicative
instance, there is no correspondingBind
orMonad
instance.AccValidation
is an example of, "An applicative functor that is not a monad."
It isn't evident to me why this is a consequence. I can imagine a Monad
instance for AccValidation
that behaves like Either
- What would make this unlawful?