Proposal: Warn when using Enum instance of Float or Double
simonpj at microsoft.com
Mon Jun 17 09:59:30 CEST 2013
I don't think it would be that hard to add DEPRECATE for instances. A bit fiddly, and what should the syntax be.. but not really hard. I can offer advice if someone wants to undertake it.
It's a cost/benefit question: how often will it be used?
| -----Original Message-----
| From: libraries-bounces at haskell.org [mailto:libraries-
| bounces at haskell.org] On Behalf Of Henning Thielemann
| Sent: 16 June 2013 10:12
| To: harry
| Cc: libraries at haskell.org
| Subject: Re: Proposal: Warn when using Enum instance of Float or Double
| On Sun, 16 Jun 2013, harry wrote:
| > The Enum instances for Float and Double have dubious semantics which
| > endless confusion, e.g.
| > http://stackoverflow.com/questions/13203471/the-math-behind-1-
| > http://stackoverflow.com/questions/9810002/floating-point-list-
| > http://stackoverflow.com/questions/7290438/haskell-ranges-and-floats,
| > http://stackoverflow.com/questions/10328435/how-to-solve-floating-
| > and many more.
| > I would therefore like to propose that the usage of an Enum instance
| > Float or Double generate a compiler warning, such as "The Enum
| instance of
| > Float is subject to rounding errors". Deadline: 2 weeks.
| I would also like to see these instances be removed or deprecated.
| Unfortunately, GHC currently does not allow to DEPRECATE an instance.
| this feature one might also tag intentionally omitted instances, like
| instance for (or 'of' :-) functions:
| Libraries mailing list
| Libraries at haskell.org
More information about the Libraries