Haddock: Display instance strategies
Summary
Add provenance information to (Haddock) instance lists. Display groups of instances sorted by how they were written or derived.
One group for those that are hand-written and then one for each deriving strategy: stock, anyclass, newtype, via. Deriving via forms a subgroup for each via type.
This helps the reader, which can now infer information about the instances without looking at the source (and is even more precise than the source, unfortunately people rarely use explicit DerivingStrategies and the strategy selection algorithm is arcane!). Each strategy (not written by hand) uniquely determine the instance, if newtype X = X Int
uses newtype deriving the resulting instances are determined by Int
. Adding this to Haddock communicates this.