
25 Sep
2014
25 Sep
'14
5:38 a.m.
On 2014-09-25 at 05:25:02 +0200, David Feuer wrote:
As Edward Kmett explained to me, (/=) is currently needed in Eq to support IEEE floating point semantics for (==) and (/=). As I see it, those semantics are badly broken from the perspective of what Eq is supposed to mean, and really should be supported using special functions (eqIEEE and neqIEEE or whatever), whereas the most appropriate Eq instance for floating point would be something more like
If the Eq instance for Double is changed, what about its Ord instance then? Right now, (0/0::Double) is handled poorly for both Eq and Ord, resulting in Data.Map and other operations relying on Eq/Ord to behave weirdly when (0/0::Double) happens to be used as key.