
#7939: RHS of associated type not kind-checked ------------------------------------------+--------------------------------- Reporter: goldfire | Owner: goldfire Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: GHC accepts invalid program | Difficulty: Unknown Testcase: ghci/scripts/T7939 | Blockedby: Blocking: | Related: ------------------------------------------+--------------------------------- Comment(by monoidal): Replying to [comment:11 goldfire]:
Now, {{{D}}} doesn't look GADT-like in its kind parameter, which is always just {{{k}}}. The difference between the version that works and the version that doesn't is that pattern-matching on the version that works does ''not'' refine information about the kind {{{k}}}. In fact, you can see this easily because you can write more instances for either {{{A}}} or {{{B}}} showing that the kind argument is not really fixed by this construction.
I see, thanks. One last question - does anything change in your comment if I use a closed type family? Like this: {{{ type family F :: k where F = Maybe x :: Maybe F x = Nothing }}} Should this be legal? While the type `F` has kind `k`, it works effectively as a synonym for `Maybe`, which is kind `* -> *`. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7939#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler