Proposal: Make Eq type class single method

Joachim Breitner mail at
Mon Oct 25 09:04:50 UTC 2021


current status of this train of thought:

* Most people here were sympathetic about the removal of (/=) from Eq.

* It would break a bit of code, but with an easy and backward-
  compatible fix.

* The GHC implementation is straight forward:

* There is _no_ measurable performance benefit in real-world-code.
  A few of GHC’s perf regression tests benefit slightly:

    T12234(optasm) ghc/alloc    57633544.0    55409592.0  -3.9% GOOD
    T18304(normal) ghc/alloc    87566616.0    83503296.0  -4.6% GOOD
      T783(normal) ghc/alloc   389240752.0   377482584.0  -3.0% GOOD
     T1969(normal) ghc/max    19869024.0    19071720.0  -4.0% 
    T11545(normal) ghc/max    35580832.0    33828936.0  -4.9% 

* There is a problem with rules matching on class ops of single method 
  I consider this a GHC bug that needs to be fixed anyways, so let’s
  assume for now it will be fixed one way or another before Eq becomes
  a single method class.

With this, I’d like to formally bring this change before the CLC, and
ask for its support for (or explicit rejection of) this change.


Joachim Breitner
  mail at

More information about the Libraries mailing list