Deprecate Foldable for Either

Oleg Grenrus oleg.grenrus at iki.fi
Thu Mar 2 22:35:14 UTC 2017


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 haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20170303/53180779/attachment.sig>


More information about the Libraries mailing list