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

"GHC" <[email protected]> Mon, 04 Mar 2019 13:59:08 -0000
Newsgroups gmane.comp.lang.haskell.glasgow.bugs
Message-ID <[email protected]>
#16384: GHC infers ill-kinded type for typed TH splice with unlifted values
-------------------------------------+-------------------------------------
           Reporter:  gridaphobe     |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.6.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 As noted in the [https://github.com/ghc-proposals/ghc-proposals/pull/209
 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#)
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16384>