#3480: Easily make Typeable keys  pure, so that Typeable can be handled
efficiently across communications
-----------------------------+----------------------------------------------
  Reporter:  guest           |          Owner:                      
      Type:  task            |         Status:  new                 
  Priority:  normal          |      Milestone:  6.14.1              
 Component:  libraries/base  |        Version:                      
Resolution:                  |       Keywords:  Typeable, efficiency
Difficulty:  Unknown         |             Os:  Unknown/Multiple    
  Testcase:                  |   Architecture:  Unknown/Multiple    
   Failure:  None/Unknown    |  
-----------------------------+----------------------------------------------
Changes (by simonpj):

  * failure:  => None/Unknown

Comment:

 I talked to Simon M about the question of tidying up GHC's `TypeRep`
 mechanism.  A good start would be the following:

  1. Generate a fingerprint from the `String` (including the fully-
 versioned module) of the `TyCon` (eg "`base-4.3.2.2:GHC.Arr.Array`")

  2. At each `App` node in the `TypeRep` generate a fingerprint from the
 fingerprints of the component pieces.  We do this all the time when
 generating fingerprints in interface files.  (This would retain constant-
 time comparison for `TypeRep`.)

 This would completely deal with the single-program case, because in any
 one program there is definitely only one type constructor
 `base-4.3.2.2:GHC.Arr.Array`.  If we wanted a stronger, cross-program,
 story, then we'd need a stronger fingerprint under (1), based on the type
 structure as outlined in an earlier comment.  That is quite doable too,
 but would probably require us to inject a binding for each `TyCon`
 fingerprint only ''after'' they'd been computed in `MkIface`.  A bit more
 plumbing, that's all.

 This would be a straightforward project for someone to do.  Since the
 fingerprinting for `TypeRep` must be done in `Data.Typeable`, which is in
 the `base` package, we'd need to add fingerprinting technology to `base`.
 Not hard, since GHC itself already has it, so we can just copy it over.
 But we don't want to make `base` depend on the `binary` package, so
 something a bit less general than GHC's fingerprinting interface is
 wanted.

 Any volunteers?

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3480#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to