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

GHC ghc-devs at haskell.org
Thu Sep 6 09:05:07 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 mpickering):

 The inferred type of `test_foo2` is exactly what you suggest it shouldn't
 be unless I am misunderstaning.

 {{{
 *SP> :t test_foo2
 test_foo2
   :: forall {a}.
      Num a =>
      Language.Haskell.TH.Syntax.Q
        (Language.Haskell.TH.Syntax.TExp (a -> a))
 }}}

 The difference is now that you can't splice back in `test_foo2` without
 instantiating `a` as otherwise the ambiguous type variable stops `Num a`
 being solved.

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


More information about the ghc-tickets mailing list