Proposal: Bounded instance for IntSet (ticket #1953)

David Benbennick dbenbenn at gmail.com
Mon Dec 3 11:08:58 EST 2007


On 12/3/07, Yitzchak Gale <gale at sefer.org> wrote:
> David Benbennick wrote:
> > Note that in one sense, people are already prevented from defining a
> > different Bounded instance.  Any Bounded instance other than the one
> > suggested in this proposal would fail to obey the axioms of the
> > Bounded class.  In other words, there is a unique largest element, and
> > a unique smallest element, an no one can legitimately define a
> > different Bounded instance.
>
> Where are these axioms? I only see the Haddocks in the Prelude:
>
> "Ord is not a superclass of Bounded since types that are not
> totally ordered may also have upper and lower bounds."

See http://haskell.org/ghc/docs/latest/html/libraries/base-3.0.0.0/Prelude.html#t%3ABounded
The first sentence there says "The Bounded class is used to name the
upper and lower limits of a type".  In other words, you can't just
pick any old values for minValue and maxValue.


More information about the Libraries mailing list