[GHC] #15471: Polymorphism, typed splices and type inference don't mix

GHC ghc-devs at haskell.org
Thu Sep 6 09:20:42 UTC 2018


#15471: Polymorphism, typed splices and type inference don't mix
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                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:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Yes, GHC infers `test_foo2 :: forall a. Num a => Q (TExp (a->a))`.  You
 like that -- good.

 But now what would you ''expect'' to happen here?
 {{{
 qux = $$(test_foo2)
 }}}
 We must pass a dictionary, so we probably default to `Integer`. And that's
 precisely what is happening in the Description, except that there we
 default to `Any` because we don't have to satisfy `Num`.

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


More information about the ghc-tickets mailing list