Proposal: fix Enum Double instance
Henning Thielemann
lemming at henning-thielemann.de
Sat Jul 6 19:12:21 CEST 2013
On Fri, 5 Jul 2013, Twan van Laarhoven wrote:
> I would like to make a counterproposal in the Enum Double debate: Instead of
> deprecating or removing the instances, how about just fixing them?
>
> A perfect instance for Enum Double is not possible, because arithmetic is
> inexact. But you can actually get awfully close. I.e. instead of allowing the
> final value to be at most step/2 past the end, we can allow it to be at most
> about 2e-16*step past the end. In many practical applications this is close
> enough to not be a problem.
That is, it will make problems with numerical inaccuracies more seldom,
i.e. harder to detect?
Why is it important to use the enumFrom* functions, i.e. [x..] syntax? Why
not using 'takeWhile (<y) $ iterate (d+) x' ?
More information about the Libraries
mailing list