`compareInt` should get the `matching_overloaded_methods_in_rules` treatment.
In base most instance methods are defined in this pattern:
instance C T where
m x y = impl x y
{-# INLINE[1] #-}
impl = rhs
As matching_overloaded_methods_in_rules explains this is in order to allow writing rules on the concrete impl method used instead on the polymorphic class methods.
For some reason however we excluded compareInt and compareWord from this pattern. I don't see a reason why and it would allow one to write rules like:
{-# RULES
"maximumByInt" forall. maximumBy compareInt = maximum
#-}
It has been like this for over 10 years so not high priority by any means. But might be useful.
Edited by sheaf