[GHC] #11719: Cannot use higher-rank kinds with type families

GHC ghc-devs at haskell.org
Fri Oct 12 08:34:45 UTC 2018


#11719: Cannot use higher-rank kinds with type families
-------------------------------------+-------------------------------------
        Reporter:  ocharles          |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler (Type    |              Version:  8.0.1-rc2
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  GHC rejects       |            Test Case:
  valid program                      |  dependent/should_compile/T11719
      Blocked By:                    |             Blocking:
 Related Tickets:  #13913            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by simonpj):

 * cc: csongor.kiss14@…, s.eisenbach@…, t.field@… (added)


Comment:

 > The difference with terms is that the arity of type families matters. F1
 has arity 1, while F2 has arity 0. The real question is: where is the k
 bound. In F1, k is bound "before the colon", while in F2, it's bound after
 the colon.

 Tricky stuff! Could we document this in the user manual?

 If we end up adopting Csongor's ideas about unsaturated type families
 (when the matchability shows up in the kind), we'll need to adopt some
 notation for the forall-case too.

 I can't say I like `forall k '. k -> Type`!  But we clearly need
 ''something''.

 > Perversely, type families can pattern-match only on unmatchable
 arguments. Perhaps a name change is in order.

 That is indeed perverse.  Worth considering as part of the same effort.

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


More information about the ghc-tickets mailing list