[GHC] #12367: Commit adding instances to GHC.Generics regression compiler performance

GHC ghc-devs at haskell.org
Tue Jul 12 09:14:05 UTC 2016


#12367: Commit adding instances to GHC.Generics regression compiler performance
-------------------------------------+-------------------------------------
        Reporter:  bgamari           |                Owner:  bgamari
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.2
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:  Generics
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by bgamari):

 It's not entirely clear how to proceed from here. The problem here is that
 we want to provide `Generic` instances for many types in `base`, while at
 the same time providing, e.g., `Foldable` and `Monoid` instances for the
 generic representation types.

 As far as I can tell we have a few options,

 1. Keep the status quo and accept the fact that much of `base` pulls is
 `GHC.Generics`
 2. Move the data types in `GHC.Generics` to a new `GHC.Generics.Internal`
 module, placing the the instances in `GHC.Generics`. This would mean that
 `GHC.Generics` would be full of orphans but that fewer modules within
 `base` would need to import the full bulk of the instances. That being
 said, this does nothing to help users who use `GHC.Generics` but none of
 the instances.
 3. Wire-in the generics representation types to hopefully avoid the need
 to pull in the interface file at all when deriving `Generic` (assuming
 that GHC in fact is capable to avoid pulling in interface files when
 loading only wired-in declarations).
 4. Add `hs-boot` files for `Foldable`, `Traversable`, et al., allowing us
 to move the instances for the `GHC.Generics` types to `GHC.Generics`
 5. Something else?

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


More information about the ghc-tickets mailing list