[GHC] #8165: Use GeneralizedNewtypeDeriving to automatically create associated type families

GHC ghc-devs at haskell.org
Tue Oct 25 13:14:21 UTC 2016


#8165: Use GeneralizedNewtypeDeriving to automatically create associated type
families
-------------------------------------+-------------------------------------
        Reporter:  MikeIzbicki       |                Owner:  RyanGlScott
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler (Type    |              Version:  7.6.3
  checker)                           |
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #2721             |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * owner:  goldfire => RyanGlScott


Comment:

 Right, I didn't say the last type parameter of `T` had to be the newtype.
 Rather, the last type parameter of the class `C` (`z` in the example in
 comment:18) just has to occur somewhere in the type parameters of `T`.

 > I'm far from sure if this is really worth the effort of explaining and
 implementing it.

 I disagree! Really, this is a quite straightforward idea (with a couple of
 small gotchas, like the one you observed), and I've implemented most of it
 already—I just need to polish up the documentation, update the GHC wiki,
 and post a Phabricator Diff.

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


More information about the ghc-tickets mailing list