Enum on Float/Double
George Russell
ger@tzi.de
Fri, 25 Oct 2002 11:49:54 +0200
Ketil Z Malde wrote:
>
> George Russell <ger@tzi.de> writes:
>
> > The situation with Enum on Ratio is pretty bad but at least
> > it's not hopeless, since rational numbers are at least exact. But
> > for Float/Double it seems to be a total disaster area.
>
> My vote would be to scrap it. Enum sounds like it defines an ordering
> of elements, and that's IMHO not what the actual implementation looks
> like. But I suppose it will have to wait.
>
> > My preference would be for succ (+-0) to return the smallest positive
> > real, since then you could define succ x to be the unique y with
> > x < y and forall z . z < y => not (x < z), where such a y exists, and
> > I'm not sure if the Haskell standard knows about signed zeros.
>
> Is this really useful? Why would you need this number? Peano
> artithmetic on reals? :-)
succ +- 0 is not very important, but having succ/pred return the
next representable real is occasionally useful.