[GHC] #13546: Kind error with type equality

GHC ghc-devs at haskell.org
Mon Apr 10 09:08:07 UTC 2017


#13546: Kind error with type equality
-------------------------------------+-------------------------------------
        Reporter:  int-index         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |
      Resolution:                    |             Keywords:  TypeInType
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by int-index):

 I did not realize that `k` is a parameter, now the error is clear to me.
 However, than the definition of `UnT` should be rejected, no?

 {{{#!hs
 type family UnT (a :: Type) :: k where
   UnT (T (t :: k')) = t
 }}}

 `UnT` has kind `forall k. Type -> k`, but in the clause `UnT (T t) = t` it
 returns something of the kind `k'`. There's no guarantee that `k ~ k'`.

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


More information about the ghc-tickets mailing list