[GHC] #11324: Missing Kind Inference

GHC ghc-devs at haskell.org
Thu Dec 31 15:07:57 UTC 2015


#11324: Missing Kind Inference
-------------------------------------+-------------------------------------
        Reporter:  crockeea          |                Owner:
            Type:  bug               |               Status:  closed
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:  invalid           |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by rwbarton):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 > I think GHC should know the kind from the constraint on `foo`.

 The kind of what? Since `CharOf` is polykinded in its result kind, there
 could be two different instances
 {{{
 type instance CharOf T = True -- really "type instance CharOf Bool T =
 True"
 type instance CharOf T = ()   -- really "type instance CharOf *    T = ()"
 }}}
 The occurrence of `CharOf fp` in `MyConstraint (CharOf fp)` must have kind
 `Bool`, because that is the kind that `MyConstraint` takes. But there is
 no reason why the subsequent occurrence of `CharOf fp` must have the same
 kind. This is illustrated by your two working examples. In the first one,
 `Bin` is not `Bool`!

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


More information about the ghc-tickets mailing list