[GHC] #15437: Internal error when applying a scoped type variable inside a typed expression quotation

GHC ghc-devs at haskell.org
Thu Nov 1 12:34:00 UTC 2018


#15437: Internal error when applying a scoped type variable inside a typed
expression quotation
-------------------------------------+-------------------------------------
        Reporter:  dminuoso          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Template Haskell  |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13587, #15835    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 I don't think types are really dealt with properly in typed template
 haskell. Your program is a lot like

 {{{
 foo :: Int -> Q (TExp Int)
 foo x = [|| x ||]
 }}}

 In this case, we have to interpret the `x` as `$(lift x)` and we should do
 the same thing for types here.

 To go back to your program and some pseudo syntax:

 {{{
 foo :: forall a. Q (TExp Int)
 foo = [|| get @$(lift a) ||]
 }}}

 We really mean something like this as the value of `a` is bound at
 compile-time but not at run-time so if we want to use it we have to use it
 in a splice.

 Does that sound sensible Simon?

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15437#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list