isUnliftedTyCon is ill-defined with UnliftedDatatypes
According to Note [Any types]
in GHC.Builtin.Types
,
* If (Any k) is the type of a value, it must be a /lifted/ value. So
if we have (Any @(TYPE rr)) then rr must be 'LiftedRep. See
Note [TYPE and RuntimeRep] in GHC.Builtin.Types.Prim. This is a convenient
invariant, and makes isUnliftedTyCon well-defined; otherwise what
would (isUnliftedTyCon Any) be?
This looks wrong.
-
We now have UnliftedDatatypes, which make
data T :: TYPE (BoxedRep l)
valid. What shouldisUnliftedTyCon
say aboutT
? -
Is that invariant still valid? There's nothing to verify it as far as I can tell. If not, the comment should be removed.
Perhaps we should remove isUnliftedTyCon
in the light of UnliftedDatatypes
.