Proposal (long term): Remove (/=) from Eq; change the semantics of (==) for floating point

David Feuer david.feuer at
Thu Sep 25 03:25:02 UTC 2014

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

instance Eq Double where
  x == y   =  decodeFloat x == decodeFloat y

If this is (eventually) done, that would allow us to remove (/=) from Eq,
reducing its dictionary to a single member, (==), improving efficiency when
the type is not statically known.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list