[GHC] #11498: GHC requires kind-polymorphic signatures on class head

GHC ghc-devs at haskell.org
Mon Oct 1 17:26:20 UTC 2018


#11498: GHC requires kind-polymorphic signatures on class head
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                Owner:  (none)
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.10.2-rc2
  checker)                           |
      Resolution:  duplicate         |             Keywords:  CUSKs
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13365            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * status:  new => closed
 * resolution:   => duplicate
 * related:   => #13365


Comment:

 OK, I now understand what is going on here. The fact that the second
 version of `C` doesn't typecheck in comment:2 is expected behavior. Once
 again, this all comes back to the fact that `C` doesn't have a complete
 user-specified kind (CUSK). As a result, the kind of `a` (in `class  C a`)
 is chosen to be some fresh kind variable `k0`. When you try to declare a
 method of type `forall k. Proxy (a :: k) -> Proxy (b :: k)`, GHC complains
 because the kind `k` is bound in the method's type signature and //not//
 by the class (which binds `k0`), and thus `k` is not the same as `k0`.

 GHC perhaps ought to warn about the lack of a CUSK here, but that is the
 subject of #13365. Therefore, I'm opting to close this ticket and a
 duplicate of that one.

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


More information about the ghc-tickets mailing list