Proposal: Bounded instance for IntSet (ticket #1953)
Ian Lynagh
igloo at earth.li
Sun Dec 2 19:29:45 EST 2007
On Sun, Dec 02, 2007 at 04:23:11PM -0800, Stefan O'Rear wrote:
> On Sun, Dec 02, 2007 at 04:01:05PM -0800, David Benbennick wrote:
> > On 12/2/07, Ross Paterson <ross at soi.city.ac.uk> wrote:
> > > These are the minimum and maximum under the Ord instance (also for Set),
> > > but what is the intuition behind that ordering?
> >
> > The order on IntSet is the well-known lexicographic order (see
> > http://en.wikipedia.org/wiki/Lexicographical_order). If this proposal
> > is accepted, I intend to propose the Bounded instance for Set next
> > (Bounded a => Bounded (Set a)).
>
> This contradicts your code, for the maximal element in the lexicographic
> order is *not* singleton maxBound, but rather fromList [minBound ..
> maxBound].
I think he means lexicographic order of toAscList set. I agree that
lexicographic order of toDescList makes more intuitive sense to me,
though.
Thanks
Ian
More information about the Libraries
mailing list