Proposal: Warn when using Enum instance of Float or Double

Henning Thielemann lemming at
Sun Jun 16 11:12:07 CEST 2013

On Sun, 16 Jun 2013, harry wrote:

> The Enum instances for Float and Double have dubious semantics which cause
> endless confusion, e.g.
> 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.

I would also like to see these instances be removed or deprecated. 
Unfortunately, GHC currently does not allow to DEPRECATE an instance. With 
this feature one might also tag intentionally omitted instances, like Num 
instance for (or 'of' :-) functions:

More information about the Libraries mailing list