Enable PolyKinds in GHC.Generics
As suggested in [this](https://mail.haskell.org/pipermail/libraries/2015-July/025981.html) Haskell libraries mailing list thread. Among other benefits, this would allow use of generic functions with `Proxy t` when `t` is of a kind other than `*`.
There seem to be more changes required than just putting `{-# LANGUAGE PolyKinds #-}` in `GHC.Generics`, however, since I tried doing that myself and found myself unable to properly derive `Generic(1)` instances in `GHC.Generics`. Here is a snippet of the resulting error message:
```
libraries/base/GHC/Generics.hs:826:1: error:
Couldn't match type ‘M1 i0 c0 (M1 i1 c1 U1) p0’ with ‘M1 D x’
Expected type: Rep (Proxy t) x
Actual type: M1 i0 c0 (M1 i1 c1 U1) p0
Relevant bindings include
from :: Proxy t -> Rep (Proxy t) x
(bound at libraries/base/GHC/Generics.hs:826:1)
In the expression: M1 (M1 U1)
In an equation for ‘from’: from Proxy = M1 (M1 U1)
When typechecking the code for ‘from’
in a derived instance for ‘Generic (Proxy t)’:
To see the code I am typechecking, use -ddump-deriv
libraries/base/GHC/Generics.hs:826:1: error:
Couldn't match type ‘M1 t0 t1 (M1 t3 t4 U1) t2’ with ‘M1 D x’
Expected type: Rep (Proxy t) x
Actual type: M1 t0 t1 (M1 t3 t4 U1) t2
Relevant bindings include
to :: Rep (Proxy t) x -> Proxy t
(bound at libraries/base/GHC/Generics.hs:826:1)
In the pattern: M1 (M1 U1)
In an equation for ‘to’: to (M1 (M1 U1)) = Proxy
When typechecking the code for ‘to’
in a derived instance for ‘Generic (Proxy t)’:
To see the code I am typechecking, use -ddump-deriv
In the instance declaration for ‘Generic (Proxy t)’
```
<details><summary>Trac metadata</summary>
| Trac field | Value |
| ---------------------- | -------------- |
| Version | 7.10.2 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/base |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | dreixel |
| Operating system | |
| Architecture | |
</details>
<!-- {"blocked_by":[],"summary":"Enable PolyKinds in GHC.Generics","status":"New","operating_system":"","component":"libraries/base","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.10.2","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":["dreixel"],"type":"FeatureRequest","description":"As suggested in [https://mail.haskell.org/pipermail/libraries/2015-July/025981.html this] Haskell libraries mailing list thread. Among other benefits, this would allow use of generic functions with `Proxy t` when `t` is of a kind other than `*`. \r\n\r\nThere seem to be more changes required than just putting `{-# LANGUAGE PolyKinds #-}` in `GHC.Generics`, however, since I tried doing that myself and found myself unable to properly derive `Generic(1)` instances in `GHC.Generics`. Here is a snippet of the resulting error message:\r\n\r\n{{{\r\nlibraries/base/GHC/Generics.hs:826:1: error:\r\n Couldn't match type ‘M1 i0 c0 (M1 i1 c1 U1) p0’ with ‘M1 D x’\r\n Expected type: Rep (Proxy t) x\r\n Actual type: M1 i0 c0 (M1 i1 c1 U1) p0\r\n Relevant bindings include\r\n from :: Proxy t -> Rep (Proxy t) x\r\n (bound at libraries/base/GHC/Generics.hs:826:1)\r\n In the expression: M1 (M1 U1)\r\n In an equation for ‘from’: from Proxy = M1 (M1 U1)\r\n When typechecking the code for ‘from’\r\n in a derived instance for ‘Generic (Proxy t)’:\r\n To see the code I am typechecking, use -ddump-deriv\r\n\r\nlibraries/base/GHC/Generics.hs:826:1: error:\r\n Couldn't match type ‘M1 t0 t1 (M1 t3 t4 U1) t2’ with ‘M1 D x’\r\n Expected type: Rep (Proxy t) x\r\n Actual type: M1 t0 t1 (M1 t3 t4 U1) t2\r\n Relevant bindings include\r\n to :: Rep (Proxy t) x -> Proxy t\r\n (bound at libraries/base/GHC/Generics.hs:826:1)\r\n In the pattern: M1 (M1 U1)\r\n In an equation for ‘to’: to (M1 (M1 U1)) = Proxy\r\n When typechecking the code for ‘to’\r\n in a derived instance for ‘Generic (Proxy t)’:\r\n To see the code I am typechecking, use -ddump-deriv\r\n In the instance declaration for ‘Generic (Proxy t)’\r\n}}}","type_of_failure":"OtherFailure","blocking":[]} -->
issue