[GHC] #12644: Lack of instantiation in GHC 8.0.1

GHC ghc-devs at haskell.org
Fri Sep 30 09:04:22 UTC 2016


#12644: Lack of instantiation in GHC 8.0.1
-------------------------------------+-------------------------------------
           Reporter:  simonpj        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           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
 {{{
 data T a = T1 Int

 instance Show (T a) where
   show (T1 x) = show x

 t1 :: T a
 t1 = T1 1

 f :: String
 f = show t1
 }}}
 This should typecheck fine.  The `a` in data type `T` is phantom, but we
 often use phantom types.

 But it isn't with GHC 8.0.1:
 {{{
     • No instance for (Show (forall a. T a))
         arising from a use of ‘show’
     • In the expression: show t1
       In an equation for ‘f’: f = show t1
 }}}
 The problem is in the lack of instantation of `t1` in the argument of
 `show`.

 I'm fixing this, but I wanted to make a ticket to exhibit it.

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


More information about the ghc-tickets mailing list