[GHC] #7939: RHS of associated type not kind-checked

GHC ghc-devs at haskell.org
Wed Jun 26 17:50:04 CEST 2013


#7939: RHS of associated type not kind-checked
------------------------------------------+---------------------------------
  Reporter:  goldfire                     |          Owner:  goldfire        
      Type:  bug                          |         Status:  new             
  Priority:  normal                       |      Milestone:                  
 Component:  Compiler                     |        Version:  7.7             
Resolution:                               |       Keywords:                  
        Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
   Failure:  GHC accepts invalid program  |     Difficulty:  Unknown         
  Testcase:  ghci/scripts/T7939           |      Blockedby:                  
  Blocking:                               |        Related:                  
------------------------------------------+---------------------------------

Comment(by goldfire):

 I've implemented the plan above, but there is still at least one dark
 corner. Consider this:

 {{{
 class Foo a where
   type Bar a b
 }}}

 What should the kind of {{{Bar}}} be? Because classes are kind-polymorphic
 by default (which is good), the kind of {{{a}}} must be {{{k}}}. But, what
 about {{{b}}}? Right now, in both HEAD and my implementation with the fix
 for this ticket, {{{Bar}}} has the kind {{{k1 -> k2 -> *}}}. We don't
 generalize the result kind (as described above), but we still do
 generalize all arguments. It wouldn't be hard to separate out the
 arguments that are bound in the class head, generalize those and not
 generalize the others, but that seems even stranger somehow.

 Thoughts?

 Expect a patch soon.

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



More information about the ghc-tickets mailing list