Skip to content

GHC infers ill-kinded type for typed TH splice with unlifted values

As noted in the Levity Polymorphic Lift proposal, GHC infers an ill-kinded type for typed splices with unlifted values. For example, in GHC 8.6.3

ghci> :t [|| 1# ||]
[|| 1# ||] :: Q (TExp Int#)

TExp Int# is ill-kinded, so this type makes no sense. And GHC knows it's ill-kinded, because it will actually reject the program if you supply the type yourself.

ghci> [|| 1# ||] :: Q (TExp Int#)

<interactive>:12:23: error:
    • Expecting a lifted type, but ‘Int#’ is unlifted
    • In the first argument of ‘TExp’, namely ‘Int#’
      In the first argument of ‘Q’, namely ‘(TExp Int#)’
      In an expression type signature: Q (TExp Int#)
Trac metadata
Trac field Value
Version 8.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information