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

GHC ghc-devs at haskell.org
Wed Sep 5 14:43:44 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):

 I still claim there is some bug here for two reasons.

 1. The result is unusable after splicing.
 2. A very similar program using static pointers works fine.

 {{{
 foo = static (id :: forall a . a -> a )

 foo2 = [|| id :: forall a . a -> a ||]
 }}}

 In GHCi

 {{{
 > (deRefStaticPtr foo) 'a'
 'a'

 > ($$(foo2)) 5

 <interactive>:89:12: error:
     • No instance for (Num Any) arising from the literal ‘5’
     • In the first argument of ‘$$(foo2)’, namely ‘5’
       In the expression: ($$(foo2)) 5
       In an equation for ‘it’: it = ($$(foo2)) 5

 }}}

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


More information about the ghc-tickets mailing list