[Haskell-cafe] Unnecessarily strict implementations

Arie Peterson ariep at xs4all.nl
Thu Sep 2 14:57:12 EDT 2010


On Thu, 2 Sep 2010 19:30:17 +0200, Daniel Fischer
<daniel.is.fischer at web.de> wrote:
> Why would one consider using Ord for Map an abuse?
> A kludge, for performance reasons, but an abuse?

Because it forces one to declare Ord instances for types which have no
natural ordering. It is useful to *not* have such instances, in order to
catch programming errors.

A separate type class for types which can be ordered in some (possibly
arbitrary) way, for use in Data.Map, would remedy this.


Regards,

Arie



More information about the Haskell-Cafe mailing list