This commit implements the proposal in
Here are some of the pieces of that proposal:
- Some of RuntimeRep's constructors have been shortened.
- TupleRep and SumRep are now parameterized over a list of RuntimeReps. This means that two types with the same kind surely have the same representation. Previously, all unboxed tuples had the same kind, and thus the fact above was false.
- RepType.typePrimRep and friends now return a *list* of PrimReps. These functions can now work successfully on unboxed tuples. This change is necessary because we allow abstraction over unboxed tuple types and so cannot always handle unboxed tuples specially as we did before.
- The RepType.RepType type was removed, as it didn't seem to help with much.
- The RepType.repType function is also removed, in favor of typePrimRep.
- I have waffled a good deal on whether or not to keep VoidRep in TyCon.PrimRep. In the end, I decided to keep it there. PrimRep is *not* represented in RuntimeRep, and typePrimRep will never return a list including VoidRep. But it's handy to have in, e.g., ByteCodeGen and friends. I can imagine another design choice where we have a PrimRepV type that is PrimRep with an extra constructor. That seemed to be a heavier design, though, and I'm not sure what the benefit would be.
- The last, unused vestiges of # (unliftedTypeKind) have been removed.
This code is also available on the wip/rae branch of the main GHC repo. Beware of upstream rebases here, though.