[GHC] #13192: Ambiguity Caused By PolyKind and Not Helpful Error Messages

GHC ghc-devs at haskell.org
Fri Jan 27 13:45:06 UTC 2017


#13192: Ambiguity Caused By PolyKind and Not Helpful Error Messages
-------------------------------------+-------------------------------------
        Reporter:  Shayan-Najd       |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by goldfire):

 To add more information: this code is accepted without `PolyKinds`,
 because `F (I a)` can immediately reduce to `a`. With `PolyKinds`, `F (I
 a)` is stuck, as we don't know `a`'s kind. (The equation for `F` works
 only when `(a :: Type)`.)

 Perhaps the best fix is to add a check in !TcErrors for type families that
 match on invisible parameters (i.e., kinds) and emit a {{{NB: Type family
 `F' has equations that depend on the kind of its argument(s)}}}.

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


More information about the ghc-tickets mailing list