How to describe this bug?

Aleksey Khudyakov alexey.skladnoy at
Fri Jul 13 13:29:58 CEST 2012

On 13.07.2012 14:18, Sönke Hahn wrote:
> On 07/13/2012 03:12 AM, Bardur Arantsson wrote:
>> Speaking of which... would it be remiss of me to mention the elephant in
>> the room, namely the Eq instance for Float?
>> AFAICT there is no possible way for a Float value to fulfill the Eq type
>> class requirements, so why is it an instance? (I'm thinking of the
>> "weird" Nan/Infinity behvaior primarily). Is there *really* such a huge
>> amount of code out there that relies on an Eq (or Ord for that matter!)
>> instance for Float? If so... shouldn't that code be fixed rather than
>> being subtly buggy?
> Num inherits from Eq, so Float couldn't have an instance for Num if we
> didn't have that Eq instance.
No more since GHC 7.4. But Eq is indeed superclass of Ord and it Ord is 
used a lot.

More information about the Glasgow-haskell-users mailing list