[GHC] #15810: Kind inference error in classes

GHC ghc-devs at haskell.org
Sat Nov 24 21:05:20 UTC 2018


#15810: Kind inference error in classes
-------------------------------------+-------------------------------------
        Reporter:  goldfire          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D5305
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 > Did you mean for the last example in comment:4 to be different than the
 first?

 Yes I did.  Now fixed.

 Data type decls (in GADT style) are different to class decls.  In a data
 type decl the type variables from the head do not scope over the
 individual data con signatures.  So your example really reads
 {{{
 data T a wher
   MkT :: forall k a. T (a :: k)
 }}}
 and the following would be equally acceptable
 {{{
 data T a wher
   MkT :: T (b :: k)
 }}}
 But with classes the type variables from the class header do indeed scope
 over the method declarations.  So they are already inconsistent in that
 sense.

 I still say "no bug here" :-).

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


More information about the ghc-tickets mailing list