[GHC] #11101: Expand Template Haskell type splices before quantification

GHC ghc-devs at haskell.org
Tue Nov 17 10:44:13 UTC 2015


#11101: Expand Template Haskell type splices before quantification
-------------------------------------+-------------------------------------
           Reporter:  simonpj        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  7.10.2
           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:
-------------------------------------+-------------------------------------
 Consider
 {{{
 f :: Int -> $(foo)
 f = ...
 }}}
 This is a Template Haskell type splice. What if `$(foo)` expands to `a ->
 a`.  Then it should all behave as if you'd written
 {{{
 f :: Int -> a -> a
 f = ...
 }}}
 But it doesn't, because we collect the variables over which we will
 implicitly quantify ''before expanding splices''.

 This is made yet more tricky when we add type wildcards to the mix.

 And really there is no good reason for this trouble.  We should simply
 expand the splice, and ''then'' decide what to quantify over. A little bit
 of refactoring in `RnTypes`.

 This ticket is just to record that I intend to do this shortly.

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


More information about the ghc-tickets mailing list