Re-engineer the derived Ord instance generation code (fix Trac #4019)
As well as fixing #4019, I rejigged the way that Ord instances are generated, which should make them faster in general. See the Note [Generating Ord instances]. I tried to measure the performance difference from this change, but the #4019 fix only removes one conditional branch per iteration, and I couldn't measure a consistent improvement. But still, tihs is better than before.
Showing with 301 additions and 293 deletions