A more useful Monoid instance for Data.Map
Jeff Shaw
shawjef3 at gmail.com
Wed Mar 13 22:09:21 CET 2013
On 3/13/2013 4:53 AM, Milan Straka wrote:
>> -----Original message-----
>> From: Johan Tibell <johan.tibell at gmail.com>
>> Sent: 12 Mar 2013, 13:00
>>
>> On Tue, Mar 12, 2013 at 12:13 PM, Ben Gamari <bgamari.foss at gmail.com> wrote:
>>
>>> I suppose this means that we need to resign ourselves to living with the
>>> instance to eternity?
>>>
>> Most likely. Fortunately there's an infinite amount of other things we can
>> work on, like writing new libraries! :)
> One way to go would be to define a new set of API for containers instead
> of modifying the current one, e.g., create Data.Containers.Ord{Set,Map}.
>
> There are several issues with the current API -- wrong Monoid instance
> being one of those, maybe lack of class hierarchy, wrong module names --
> Data.Map is really a Data.OrdMap, some people being unhappy with the API
> as it is, and so on.
>
> The problem is that devising new API that would make everybody happy is
> quite a challenging task :) But it wouldn't be so bad probably, the
> current API is not terribly wrong.
>
> Cheers,
> Milan
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
I've been following this thread for a while, and I have to say I like
Milan's suggestion. It is backwards compatible for those who need the
original libraries, and the people who like the new implementation can
start using it. This could involve some duplicate work between the two
branches for a while, but the old one can be depreciated whenever the
maintainer(s) like.
Jeff
More information about the Libraries
mailing list