[GHC] #14419: Check kinds for ambiguity

GHC ghc-devs at haskell.org
Fri Nov 3 18:55:05 UTC 2017


#14419: Check kinds for ambiguity
-------------------------------------+-------------------------------------
           Reporter:  goldfire       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 GHC does an ambiguity check on types. It should also do the same for
 kinds. Here is a program that should be rejected:

 {{{#!hs
 type family F a
 data T :: F a -> Type
 }}}

 `T`'s kind is ambiguous, and any occurrence of `T` will be rejected.
 Instead of rejecting usage sites, let's just reject the definition site.

 This check would be disabled by `AllowAmbiguousTypes`.

 Happily, I think the implementation should be easy, and that the current
 algorithm to check for ambiguous types should work for kinds, too. After
 all, types and kinds are the same these days.

 This was inspired by #14203, but no need to read that ticket to understand
 this one.

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


More information about the ghc-tickets mailing list