[GHC] #9821: DeriveAnyClass support for higher-kinded classes + some more comments

GHC ghc-devs at haskell.org
Fri Jun 17 17:11:34 UTC 2016


#9821: DeriveAnyClass support for higher-kinded classes + some more comments
-------------------------------------+-------------------------------------
        Reporter:  dreixel           |                Owner:  dreixel
            Type:  bug               |               Status:  infoneeded
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.9
      Resolution:                    |             Keywords:  Generics
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #5462, #9968,     |  Differential Rev(s):
  #12144                             |
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:  #5462, #9968 => #5462, #9968, #12144


Comment:

 To the best of my knowledge, here's a summary of the current state of each
 of those comments:

 1. https://phabricator.haskell.org/D476?id=1443#inline-3652 - The logic of
 this check is explained more thoroughly in
 [http://git.haskell.org/ghc.git/blob/498ed2664219f7e8f1077f46ad2061aba2f57de4:/compiler/typecheck/TcDeriv.hs#l1831
 Note (Determining whether newtype-deriving is appropriate)], which will be
 further clarified with Phab:D2280.

 2. https://phabricator.haskell.org/D476?id=1443#inline-3648 and
 https://phabricator.haskell.org/D476?id=1443#inline-3646 ask to clarify
 that `DeriveAnyClass` does indeed only work on argument types of kind `*`
 and `* -> *` at the moment. #9968 fixed these.

 So the only thing that remains is to implement support for deriving types
 of other kinds with `DeriveAnyClass`. I believe that #12144 is very
 relevant here, since I don't see a way to properly fix that ticket without
 overhauling the way `DeriveAnyClass` infers its instance contexts in
 `deriving` clauses. Simon's comment [https://mail.haskell.org/pipermail
 /ghc-devs/2016-June/012276.html here] provides one suggestion on how to do
 this.

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


More information about the ghc-tickets mailing list