[GHC] #10316: Move Typeable type-rep generation from use site to definition site

GHC ghc-devs at haskell.org
Thu Apr 16 21:00:33 UTC 2015


#10316: Move Typeable type-rep generation from use site to definition site
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |             Owner:
                  Type:  bug         |            Status:  new
              Priority:  normal      |         Milestone:  7.12.1
             Component:  Compiler    |           Version:  7.10.1
              Keywords:              |  Operating System:  Unknown/Multiple
          Architecture:              |   Type of failure:  None/Unknown
  Unknown/Multiple                   |        Blocked By:
             Test Case:              |   Related Tickets:
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
 This ticket is a continuation of #9858.  The interim solution for 7.10 was
 to generate `Typeable` data structures on the fly, as needed in client
 modules.  This ticket is about moving the generation of the runtime
 representation of type constructors to their definition sites.  (#9858
 already has too much going on in it, so I started a fresh ticket for this
 refactoring.)

 The branch is `wip/T9858-typeable-spj`.

 In favour of (A) code at use site (as in 7.10):
  * Pay as you go.  No code at all is generated unless you use `Typeable`

 In favour of (B) code at definition site:
  * More sharing.  We make a `TyCon` (see `Data.Typeable.Internal`) for `T`
 (say) just once, in the module that defines `T`.
  * We may ultimately want the `TyCon` for `T` to include its source
 location, and perhaps more besides.  If it is defined in `T` it becomes
 easier to do that.

 General observation: (B) is like `Typeable` was before, when it was an
 ordinary class.  The difference now is that all types are `Typeable`.

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


More information about the ghc-tickets mailing list