[GHC] #8797: Generics instances for monoid and applicative newtypes

GHC ghc-devs at haskell.org
Fri Feb 28 21:42:33 UTC 2014


#8797: Generics instances for monoid and applicative newtypes
-------------------------------+-------------------------------------------
        Reporter:  jcristovao  |            Owner:
            Type:  feature     |           Status:  new
  request                      |        Milestone:  7.8.1
        Priority:  normal      |          Version:  7.8.1-rc1
       Component:              |         Keywords:
  libraries/base               |     Architecture:  Unknown/Multiple
      Resolution:              |       Difficulty:  Easy (less than 1 hour)
Operating System:              |       Blocked By:
  Unknown/Multiple             |  Related Tickets:
 Type of failure:              |
  None/Unknown                 |
       Test Case:              |
        Blocking:              |
-------------------------------+-------------------------------------------

Comment (by Austin Seipp <austin@…>):

 In [changeset:"1a9abe7a1a3c77a028cf23640368cb45527d5834/base"]:
 {{{
 #!CommitTicketReference repository="base"
 revision="1a9abe7a1a3c77a028cf23640368cb45527d5834"
 Add some instances for Monoid/Applicative (#8797)

 As noted in the ticket, there's no particular reason why there aren't
 Generic, Typeable, and Data instances for the types in the
 Monoid/Applicative modules.

 Furthermore, Product and Sum should also have Num instances as well as
 Edward noted.

 Aside from that, this patch also changes the dependency chain slightly -
 it moves the Monoid Proxy instance into Data.Monoid and out of
 Data.Proxy.

 Why? Cycles (of course). Monoid depends on Typeable. Typeable uses
 Proxy. Proxy uses Monoid. Boom. Luckily, Proxy only depends on Monoid
 outside of the GHC namespace, so the fix is easy and clean.

 Signed-off-by: Austin Seipp <austin at well-typed.com>
 }}}

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


More information about the ghc-tickets mailing list