Haskell Foldable Wats

amindfv at gmail.com amindfv at gmail.com
Wed Feb 24 22:49:34 UTC 2016


El 24 feb 2016, a las 15:23, Manuel Gómez <targen at gmail.com> escribió:

>> 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

When I said "core libraries" I meant the libraries that everyone depends on, not just base. If (if!) we have a strong majority of users saying they don't like this instance, we should allow them to not have it. Not by rule of iron fist but of "it would be impolite to slip that instance into users' code now that we know they don't want it." Recall the switch to Writer from (,) is pretty trivial.

Re: the idea of this being a rehash of FTP: I'm an example of someone who supported FTP but would like to be able to not have this instance. Stories like Andrew Farmer's -- of not being able to make a change to your types and have the typechecker tell you what's broken -- are compelling to many of us.

Tom


> 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