[Haskell-cafe] Mystery of an Eq instance

Bardur Arantsson spam at scientician.net
Sun Sep 22 00:28:04 CEST 2013


On 2013-09-21 23:08, Mike Meyer wrote:
> Exactly. The Eq and Ord instances aren't what's broken, at least when
> you're dealing with numbers (NaNs are another story). That there are pairs

According to Haskell NaN *is* a number.

> Eq and Ord are just the messengers.

No. When we declare something an instance of Monad or Applicative (for
example), we expect(*) that thing to obey certain laws. Eq and Ord
instances for Float/Double do *not* obey the expected laws.

Regards,

/b

(*) Alas, in general, the compiler cannot prove these things, so we rely
on assertion or trust.





More information about the Haskell-Cafe mailing list