[GHC] #9171: Can't match type family with kind polymorphism

GHC ghc-devs at haskell.org
Thu Jun 5 07:38:06 UTC 2014


#9171: Can't match type family with kind polymorphism
----------------------------------------------+----------------------------
        Reporter:  MikeIzbicki                |            Owner:
            Type:  bug                        |           Status:  new
        Priority:  normal                     |        Milestone:
       Component:  Compiler                   |          Version:  7.8.2
      Resolution:                             |         Keywords:
Operating System:  Unknown/Multiple           |     Architecture:
 Type of failure:  GHC rejects valid program  |  Unknown/Multiple
       Test Case:                             |       Difficulty:  Unknown
        Blocking:                             |       Blocked By:
                                              |  Related Tickets:
----------------------------------------------+----------------------------

Comment (by kosmikus):

 Consider this small variation of your example:
 {{{
 data Base

 type family GetParam (p::k1) (t::k2) :: k3

 type instance GetParam Base Int   = Int
 type instance GetParam Base Int   = Maybe
 type instance GetParam Base Maybe = Bool

 test1 = undefined :: GetParam Base (GetParam Base Int :: *)
 test2 = undefined :: GetParam Base (GetParam Base Int :: * -> *)
 }}}

 Now `test1` has type `Int` and `test2` has type `Bool`, and the only
 difference is the intermediate kind of `GetParam Base Int` which you
 haven't specified. So I think GHC is right to complain. The kind of the
 result of `GetParam Base Int` is ambiguous without annotation, and its
 choice can in general make a difference.

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


More information about the ghc-tickets mailing list