Proposal: Bounded instance for IntSet (ticket #1953)

David Benbennick dbenbenn at gmail.com
Sun Dec 2 20:56:18 EST 2007


On 12/2/07, Ross Paterson <ross at soi.city.ac.uk> wrote:
> Yes, but when does one use that ordering on sets?

IntSet uses that ordering.

On 12/2/07, John Meacham <john at repetae.net> wrote:
> This seems fairly unintuitive me. the natural choices of minimum and
> maximum bounds for a set would seem to be
>
> singleton minBound vs singleton maxBound
>
> or
>
> empty vs universal (fromList [minBound .. maxBound]) set
>
> the odd combination of the two proposed just feels off to me.

There is no choice.  Given the existing ordering on IntSets, there is
a unique smallest element, and a unique largest element.  There is a
legitimate discussion to be had about what ordering to use on IntSets,
but that discussion is not relevant to this proposal.  No matter what
ordering you pick, IntSet will be bounded, so should be in class
Bounded.

To repeat: *** This proposal is not about changing the ordering of
IntSets.  It is only about adding the Bounded instance that is
determined by the existing ordering. ***


More information about the Libraries mailing list