Deprecate Foldable for Either

Edward Kmett ekmett at
Thu Mar 2 19:00:42 UTC 2017

I'm very strongly -1 against deprecating or removing this instance.

It removes an instance that is the only possible instance for the type for
purely proscriptive reasons. The moment someone needs it they now have to
make a new data type with completely identical instances for everything
else, but this actively gets in the way of code sharing and reuse.

On top of that, using mapM over Either or Maybe is a fairly common idiom
today, so the implications would be wide-reaching.


On Thu, Mar 2, 2017 at 11:22 AM, Andreas Abel <andreas.abel at>

> Today a student came to me wondering why a certain function produced a
> regular result, where he had expected an error.  Turned out he had used
> `concat`, but not on a lists of lists as he had thought, but on a lists of
> `Either a [b]`.
> With the Foldable instance for Either, which considers Either a b to be a
> container of 0-1 elements of b, errors are happily swallowed.
> I think this instance is harmful and should be deprecated (and later
> removed) from base.
> There are similarly pointless Foldable instances as well.
> See a discussion one year ago, which was heated, but had no consequences.
> --
> Andreas Abel  <><      Du bist der geliebte Mensch.
> Department of Computer Science and Engineering
> Chalmers and Gothenburg University, Sweden
> andreas.abel at
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list