Skip to content

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.

  1. We now have UnliftedDatatypes, which make data T :: TYPE (BoxedRep l) valid. What should isUnliftedTyCon say about T?

  2. 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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information