Deprecate Foldable for Either

Tom Murphy amindfv at
Fri Mar 3 01:03:56 UTC 2017

We had a very similar discussion this time last year (,
with many people on both sides of the issue. There wasn't enough agreement
reached to change the status quo.

I'll just repeat two things from that discussion:
  - This is *not* just an issue of "beginners may be confused": Andrew
Farmer describes encountering what I think is the most disconcerting part
of having these instances: you can no longer have confidence in the process
of change-the-type-then-just-fix-the-type-errors:

  - The tl;dr of my argument last time: "Part of the power of a type system
is which program it rejects, and I'm arguing we're cluttering the space of
valid programs."

The last time this was discussed, we planned to implement a flag to forbid
certain instances. Has anyone taken that up?


On Thu, Mar 2, 2017 at 5:35 PM, Oleg Grenrus <oleg.grenrus at> wrote:

> Anecdotally, today I wrote `foldMap toList`, to use as `Maybe (NonEmpty
> a) -> [a]`.
> Also I rely heavily in lens-based code on the `folded :: Fold (Maybe a) a`.
> So :-1: for me.
> OTOH :+1: for using non-default preludes for teaching.
> - Oleg
> On 02.03.2017 19:35, Francesco Ariis wrote:
> > On Thu, Mar 02, 2017 at 05:19:26PM +0000, Oliver Charles wrote:
> >> Personally, I think it would be a shame to lose foldMap on EIther. I
> >> frequently foldMap over Maybe values (where mempty is suitable in case
> of
> >> "failure"), and I can certainly see myself doing the same thing with
> Either.
> > I am not trying to be polemic, just to see where the community
> > stands: regarding Either/Maybe: do you have use cases for length
> > (sum) too?
> >
> > _______________________________________________
> > Libraries mailing list
> > Libraries at
> >
> _______________________________________________
> Libraries mailing list
> Libraries at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list