[GHC] #8707: Kind inference fails in data instance definition

GHC ghc-devs at haskell.org
Mon Mar 10 14:28:28 UTC 2014


#8707: Kind inference fails in data instance definition
-------------------------------------+------------------------------------
        Reporter:  goldfire          |            Owner:  jstolarek
            Type:  bug               |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:  7.7
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by jstolarek):

 Thanks for all the detail Simon. I've been looking at this for the last
 two days trying to make sense of what is going on. I have a few newbie
 questions:

 1. Kind checking type patterns (`TcTyClsDecls.tcFamTyPat` function called
 from `TcInstDcls.tcDataFamInstDecl`). Does the term "type patterns" refer
 to type parameters of a data family?

 2. From looking at `traceTc` output I see that kind checking type patterns
 includes type checking (and also inferring?) type of `SFalse` constructor
 and its components (`False` and `Ctor`). Then GHC typechecks constructor
 declarations (`TcTyClsDecls.tcConDecls` called from
 `TcInstDcls.tcDataFamInstDecl`) where it again typechecks `SFalse` and its
 components. Why is this done twice?

 I believe I can implement solution to this ticket if someone more
 experienced helps me to figure out what is the right thing to do here.

 >  Then my question remains: what's wrong with the status quo, for
 question (2)?

 I believe that Richard's point was that GHC 7.6.3 displayed kind
 parameters, which made it easier for the user to deduce what went wrong
 (ie. seeing incorrect `Bool (k -> *)` kind params instead of correct `Bool
 (Bool -> *)`.

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


More information about the ghc-tickets mailing list