Proposal: Warn when using Enum instance of Float or Double
wren ng thornton
wren at freegeek.org
Sun Jun 16 09:32:40 CEST 2013
On 6/16/13 3:26 AM, harry wrote:
> The Enum instances for Float and Double have dubious semantics which cause
> endless confusion, e.g.
> http://stackoverflow.com/questions/13203471/the-math-behind-1-0999999999999999-in-haskell,
> http://stackoverflow.com/questions/9810002/floating-point-list-generator,
> http://stackoverflow.com/questions/7290438/haskell-ranges-and-floats,
> http://stackoverflow.com/questions/10328435/how-to-solve-floating-point-number-getting-wrong-in-list-haskell,
> and many more.
>
> I would therefore like to propose that the usage of an Enum instance of
> Float or Double generate a compiler warning, such as "The Enum instance of
> Float is subject to rounding errors". Deadline: 2 weeks.
+1.
> Pedantic question: Should it be the Enum instance _of_ Float or _for_
Float?
"for".
--
Live well,
~wren
More information about the Libraries
mailing list