
We had a very similar discussion this time last year (
https://mail.haskell.org/pipermail/libraries/2016-February/026678.html),
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:
https://mail.haskell.org/pipermail/libraries/2016-February/026782.html
- 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?
Tom
On Thu, Mar 2, 2017 at 5:35 PM, Oleg Grenrus
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@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries