Proposal: Bounded instance for IntSet (ticket #1953)

David Benbennick dbenbenn at gmail.com
Mon Dec 3 20:56:50 EST 2007


On 12/3/07, Ross Paterson <ross at soi.city.ac.uk> wrote:
> But in the case at issue, the proposed Bounded instance is
> counter-intuitive because the underlying Ord instance is.  That Ord
> instance is an arbitrary choice that is accepted because it allows IntSets
> to be used as search keys; it makes no sense on its own.

I don't find that to be the case.  If you had asked me to
independently come up with an ordering on IntSets, the existing
ordering is exactly what I would have invented.  As I said earlier,
lexicographic order is very well known.  It's arbitrary, but it's a
universally-agreed arbitrary.  It's how words are ordered in paper
dictionaries, for example.

(To be precise, to compare two IntSets, you convert them to lists with
toList, then compare the lists with lexicographic order.)


More information about the Libraries mailing list