[GHC] #10760: Conflicting typefamily instances not reported with polykinds
GHC
ghc-devs at haskell.org
Sun Aug 9 08:50:02 UTC 2015
#10760: Conflicting typefamily instances not reported with polykinds
-------------------------------------+-------------------------------------
Reporter: steely | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: invalid | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC accepts | Unknown/Multiple
invalid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by steely):
I understand. This is indeed very subtle and ought to be documented.
I am not sure whether this explanation should go in the section about type
families alone, since this issue is
related to their interaction with PolyKinds, but anyway it would be more
precise to include something like:
In the paragraph about "Type Family Declarations".
The result kind annotation is optional and, as usual, defaults to * if
omitted. Polykinded type families can be
declared using a parameter in the kind annotation:
{{{
type family F a :: k
}}}
Note that in this case the kind parameter k is an actual implicit
parameter of the type family and as such is relevant
when checking the apartness of type family equations.
In the paragraph about "Compatibility and apartness of type family
equations'":
1. all corresponding types and '''implicit kinds''' in the patterns are
apart.
The example of this ticket could also be included to show this.
I am not sure whether in GHC 7.10 kind variables have to be explicitly
given in type families, making it more intuitive.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10760#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list