[ANN] either-semigroup

There are several versions of the Validation datatype floating around Hackage, but they all have huge compilation times due to depending on packages like lens and semigroupoids. This package aims to provide the alternative Semigroup functionality of Either with as few dependencies as possible.

Importantly, this keeps the same Applicative instance as Either, and does not concatenate LeftS results unless told.


I’d be interested to know the comparison to validation-selective (which I’m a maintainer of, but only to keep it building, I’m not the original author).


According to the table in the module Validation, there is a difference in the Applicative case: either-semigroup favours Failure e rather than Failure (e <> d). I have never come across selective functors and find the interface confusing, particularly for its parallel use of Either under the functor containing important data in its Left argument…

1 Like

Ah I see. Indeed the purpose of validation-selective is to gather together all the errors (semigroupally).

The surprising downside though is that when x, y :: EitherS a b, we have x *> y != x <> y. But I would have thought that many people implicitly expect such an equality to hold. This is a strength of validation-selective which also warrants the new name Validation.