[Haskell-cafe] instance Enum Double considered not entirelygreat?

Donn Cave donn at avvanta.com
Tue Sep 27 04:54:25 CEST 2011


Quoth "Richard O'Keefe" <ok at cs.otago.ac.nz>,

 [ ... re " Why would you write
   an upper bound of 0.3 on a list if you don't expect that to be included
   in the result? " ]

> Because upper bounds are *UPPER BOUNDS* and are NOT as a rule included
> in the result.  If you write [0,2..9] you
>  - DO expect 0 in the result
>  - DON'T expect 9 in the result
>  - would be outraged if 10 were in the result.

Pardon the questions from the gallery, but ... I can sure see that
0.3 shouldn't be included in the result by overshooting the limit
(i.e., 0.30000000000000004), and the above expectations about
[0,2..9] are obvious enough, but now I have to ask about [0,2..8] -
would you not expect 8 in the result?  Or is it not an upper bound?

	Donn



More information about the Haskell-Cafe mailing list