This function computes all diagnostic codes that occur inside a given
type using generics and the
GhcDiagnosticCode type family.
For example, if
T = MkT1 | MkT2,
GhcDiagnosticCode "MkT1"
= 123 and
GhcDiagnosticCode "MkT2" = 456, then we will
get > constructorCodes @T = fromList [ (123, "MkT1"), (456, "MkT2")
]