This is a work in progress.
Previously types defined by GHC.Types and GHC.Prim had their Typeable
representations manually defined in GHC.Typeable.Internals. This was
terrible, resulting in a great deal of boilerplate and a number of bugs
due to missing or inconsistent representations (see Trac #11120).
Here we take a different tack, initially proposed by Richard Eisenberg: We
wire-in the Module, TrName, and TyCon types, allowing them to be used in
GHC.Types. We then allow the usual type representation
generation logic to handle this module.
GHC.Prim, on the other hand, is a bit tricky as it has no object code of its own.
To handle this we instead place the type representations for the types defined
here in GHC.Types.
On the whole this eliminates several special-cases as well as a fair amount
of boilerplate from hand-written representations. Moreover, we get full
coverage of primitive types for free.