Proposal: Bounded instance for IntSet (ticket #1953)

Yitzchak Gale gale at sefer.org
Mon Dec 3 07:04:55 EST 2007


David Benbennick wrote:
> I propose to add a Bounded instance to IntSet.hs.

I am opposed to this proposal, unless someone
comes up with some important use cases.

Unfortunately, there is still no way to control export
of instances. So libraries should avoid defining instances
unless there is a compelling reason to do so. We need to
be reasonably certain that the usefulness of the instance
will overwhelm any unforeseen namespace pollution
problems that it may cause.

In this case, the Ord instance is not really natural; it is defined
for technical reasons for use by the library itself (and its
friends). The library has no need for a Bounded instance, so why
should we prevent people from defining one for some other purpose?

-Yitz


More information about the Libraries mailing list