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

GHC ghc-devs at haskell.org
Tue Mar 3 18:35:15 UTC 2015


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

 * owner:   => goldfire
 * milestone:   => 7.12.1


Comment:

 Encouraged by Iavor Diatchki and Adam Gundry, I've realized that my
 comment:4 is utterly wrong -- !MikeIzbicki's proposal is reasonable.

 Concretely, I propose:
  * `GeneralizedNewtypeDeriving` for classes with associated types define
 new associated type instances that "look through" to the underlying type
 instance.

 This satisfies Mike's original example. To my comment:1, it says `Int`.
 And, this proposal works for comment:3.

 Note that associated `data` instances will still be prohibited -- these
 are not covered by this ticket.

 I can implement in due course.

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


More information about the ghc-tickets mailing list