Remove Enum from Float and Double

harry voldermort at hotmail.com
Wed Jun 12 09:44:41 CEST 2013


Johan Tibell <johan.tibell at ...> writes:

> If we truly believe that the instance is dangerous for users (and not
merely for people who don't understand floating point arithmetic on
computers), then we should add a deprecation pragma to the instance and
discourage its use. But what would the deprecation message encourage
instead, for users to write an explicit loop that tests against some
lower/upper bound? It would have the same problem as enumFromTo. I think the
issue here is really that floating point math on computers is hard to think
about.

The issue is that these instances encourage problematic code. People who
know what they're doing can write whatever they want, but we shouldn't be
handing out unstable explosives on street corners :-)




More information about the Haskell-prime mailing list