I look at this:
http://hackage.haskell.org/package/either-5.0.1.1/docs/Data-Either-Validation.html
implementation of monoid:
instance Monoid e => Monoid (Validation e a) where
mempty = Failure mempty
Failure e1 `mappend` Failure e2 = Failure (e1 `mappend` e2)
Failure _ `mappend` Success a2 = Success a2
Success a1 `mappend` Failure _ = Success a1
Success a1 `mappend` Success _ = Success a1
I expect that success with error must be merged to error... and can't understand why it implemented in such a way that success with error merged to success?
So if I have a bunch of validation results and one of them is failed I expect to reduce all to fail, with merging all errors.
but:
Prelude Data.Either.Validation> Success 1 `mappend` Failure ["er1"] `mappend` Failure ["er2"]
Success 1
why?
comes to mind, if I have several validation results and if one of them pass - then total validation ok.. for such cases? for, example if I validate that contact is email or skype or phone, one of them valid, then it's ok?