Make Generic (Proxy t) instance poly-kinded (fixes #10775)
ClosedPublic

Authored by RyanGlScott on Aug 21 2015, 8:14 PM.

Details

Summary

This amounts to enabling PolyKinds in GHC.Generics. However, explicit
kind signatures must be applied to the datatypes and typeclasses in
GHC.Generics to ensure that the Core which TcGenGenerics generates
is properly kinded.

Several of the typeclasses in GHC.Generics could be poly-kinded, but
this differential does not attempt to address this, since D493 already
addresses this.

Test Plan

./validate

Diff Detail

RyanGlScott updated this revision to Diff 3903.Aug 21 2015, 8:14 PM
RyanGlScott retitled this revision from to Make Generic (Proxy t) instance poly-kinded (fixes #10775).
RyanGlScott updated this object.
RyanGlScott edited the test plan for this revision. (Show Details)
RyanGlScott added reviewers: hvr, austin, dreixel, bgamari.
RyanGlScott updated the Trac tickets for this revision.
austin accepted this revision.Aug 21 2015, 8:45 PM
austin edited edge metadata.

LGTM - @dreixel?

dreixel accepted this revision.Aug 22 2015, 5:31 AM
dreixel edited edge metadata.

Looks good to me too.

Interesting; it's a bit unfortunate that the error messages generated when the signatures are lacking (see Trac #10775) are so poor. It was not at all clear to me that kind annotations would help here. Hopefully @goldfire's type-kind unification will improve the situation here.

Interesting; it's a bit unfortunate that the error messages generated when the signatures are lacking (see Trac #10775) are so poor. It was not at all clear to me that kind annotations would help here. Hopefully @goldfire's type-kind unification will improve the situation here.

I doubt it. I think the problem in those error messages is that GHC looks at both types and kinds when simplifying type families. The kinds don't match the type instance patterns, so a type family doesn't reduce. None of this changes with D808, except perhaps the terminology, where we should talk about invisible parameters vs visible ones, instead of kinds vs types. But the error messages wouldn't change here.

Created Trac #10789 to request an improvement to the error message.

bgamari accepted this revision.Aug 25 2015, 2:16 AM
bgamari edited edge metadata.

@goldfire, thanks for the clarification.

Otherwise, this looks great. Thanks!

This revision was automatically updated to reflect the committed changes.