Consider moving Typeable evidence generation wholly back to solver
Since 91c6b1f5 we have generated a set of bindings with each datatype definition which the compiler will refer to when constructing
Typeable evidence. As described in the commit message, this came with a rather significant performance penalty, especially given that it is paid regardless of whether the code being compiled uses
The type-indexed Typeable implementation (#11011 (closed)) augments these bindings with additional information allowing the kind of a type of be reconstructing at runtime (#10343 (closed)). Unfortunately, this further blows up the cost of associated with Typeable binding generation. Some of the testsuite regressions are hard to swallow to say the least.
While I'm still working out what can be done to reduce this cost, I do wonder whether the generating these bindings at the time of type definition is so wise. Relatively few users make use of Typeable and the cost is not negligible. Moreover, generating bindings for families of tycons (e.g. unboxed sums, which have thousands of type constructors and promoted data constructors) all at once produces a truly massive amount of code (albeit it only has to be done once).
On the other hand, I suppose if Richard's dependent types story comes to fruition then perhaps the weight imposed by generating Typeable bindings at type-definition time might pull its weight.
Anyways, just idle reflections.