Proposal: Warn when using Enum instance of Float or Double

Roman Cheplyaka roma at ro-che.info
Sun Jun 16 23:33:31 CEST 2013


Hi,

This is the mailing list for libraries changes proposals.

What's the library you're proposing a change to, and what is the change
itself?

In other words, let's say your proposal gets accepted — what's next?

Roman

* harry <voldermort at hotmail.com> [2013-06-16 00:26:05-0700]
> 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.
> 
> Pedantic question: Should it be the Enum instance _of_ Float or _for_ Float?
> 
> 
> 
> 
> --
> View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-Warn-when-using-Enum-instance-of-Float-or-Double-tp5731620.html
> Sent from the Haskell - Libraries mailing list archive at Nabble.com.
> 
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries



More information about the Libraries mailing list