Deprecate Foldable for Either

Oliver Charles ollie at ocharles.org.uk
Thu Mar 2 17:19:26 UTC 2017


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.

- ocharles

On Thu, Mar 2, 2017 at 5:08 PM Francesco Ariis <fa-ml at ariis.it> wrote:

> On Thu, Mar 02, 2017 at 05:59:18PM +0100, Andreas Abel wrote:
> > Ok, Foldable is a formal condition for Traversable, but not actually
> used in
> > the implementation of Traversable Either.  This still leaves room to
> > implement Foldable for Either by
> >
> >   instance Foldable (Either a) where
> >     foldMap _ _ = error "Folding Either?  Naah, I don't think this is a
> good
> > idea."
>
> I don't fancy Foldable for Either either, but runtime failures are
> ugly too.
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170302/04d94978/attachment-0001.html>


More information about the Libraries mailing list