const package:ghc

This function obtain a diagnostic code by looking up the constructor name using generics, and using the GhcDiagnosticCode type family.
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") ]