A more useful Monoid instance for Data.Map

Milan Straka fox at ucw.cz
Wed Mar 13 09:53:06 CET 2013

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


More information about the Libraries mailing list