
21 Sep
2013
21 Sep
'13
3:21 a.m.
On 2013-09-21 06:16, Mike Meyer wrote:
The single biggest gotcha is that two calculations we expect to be equal often aren't. As a result of this, we warn people not to do equality comparison on floats.
The Eq instance for Float violates at least one expected law of Eq: Prelude> let nan = 0/0 Prelude> nan == nan False There was a proposal to change this, but it didn't really go anywhere. See: http://permalink.gmane.org/gmane.comp.lang.haskell.libraries/16218 (FWIW, even if the instances cannot be changed/removed, I'd love to see some sort of explicit opt-in before these dangerous/suprising instances become available.) Regards,