Fire RULES in the Specialiser
This MR addresses #21851 (closed).
That ticket is partly addressed by !8897 (merged). But in fact there is more "juice" to come, see the "Moreover" part of Note [Fire rules in the specialiser]
. So neither subsumes the other. Test T21851_2 is an illustration.
I thought this was going to a question of deleting one line of code: the call to isClassOpId
in rewriteClassOps
. But then I realised that I need access to the RULES in the external package state. And that led to some refactoring, including simplifying CoreMonad a bit.