Haskell Foldable Wats

Manuel Gómez targen at gmail.com
Wed Feb 24 20:23:20 UTC 2016

> El 24 feb 2016, a las 14:10, amindfv at gmail.com escribió:
>     What happened in the FTP was that the libraries@ had a heated discussion, the issue was taken to the users and to a vote, and we ended up with a clear message from users: 80% voted in one direction.
>     My suspicion is that on this issue too, libraries@ is more divided than the community is. I suggest we try to put this issue to bed, and if ~80% of the community says they don't want these instances, then yes -- core libraries should use Writer instead of redefining their own instance for (,). Similarly, if ~80% want the instances, we can grumble that users are wrong but democracy has spoken.

On Wed, Feb 24, 2016 at 2:46 PM,  <amindfv at gmail.com> wrote:
> (Sorry, I should have said: "core libraries *may* need to use Writer instead of redefining an instance for (,)" -- I don't mean to rule out other technical solutions if they exist)

I must insist: even if 80% don’t want these instances and they are
removed, they will very often get these instances.  Even if they are
removed from base, people will define instances for them in packages
most everyone will transitively depend on.  The only ways to ensure
you don’t touch these instances are

1.  to remove them from base and hope you never depend on any package,
**transitively**, that defines them, or

2.  to implement a language extension in GHC that allows source
language to specify a certain instance will never be defined and a
type error shall be thrown statically at any use site, or

3.  to implement a radical, fundamental change in the design for type
class instance visibility rules that allows them to be selectively
imported or excluded, or

4.  to avoid tuples and/or Foldable/Traversable altogether.

This cannot be solved with a vote.  A vote would only serve as a
distraction.  This was not the case with the FTP: the FTP implied
generalized signatures for terms bound to names in the Prelude and
Data.List, and you *can* control what names you import.  You can’t do
this with instances.

More information about the Libraries mailing list