[GHC] #15421: Refactor (~) to reduce the superclass stack