Changes between Initial Version and Version 1 of Ticket #2836


Ignore:
Timestamp:
Dec 2, 2008 8:45:04 AM (7 years ago)
Author:
simonpj
Comment:

Your suggestion sounds plausible to me.

There is some design to do first. Currently Data.Typeable.TyCon is really just a string (plus a key for comparison). Maybe you want three strings?

  • The package name
  • The module name
  • The TyCon name

plus accessor functions.

Another possibility (unavailable when Data.Typeable was designed I think) would be to use a Template Haskell name: Language.Haskell.TH.Syntax.Name. After all, Data.Typeable is just another form of reflection, like TH. I'm not sure what the tradeoffs are though. For example, TH names don't have a key for fast comparison. (But the keys are quite a nuisance in some ways because they may differ from run to run.)

I suggest you progress this via the library process: make proposals, encourage discussion. Actually implementing it will not be hard.

Simon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2836

    • Property Difficulty changed from to Unknown
  • Ticket #2836 – Description

    initial v1  
    1 The TyCon in Data.Typeable does not provide the qualified type name.
    2 This can be very annoying if you try to use a TypeRep as a stored representation of a type (within a run it's OK with the equality on TypeRep).
     1The !TyCon in Data.Typeable does not provide the qualified type name.
     2This can be very annoying if you try to use a !TypeRep as a stored representation of a type (within a run it's OK with the equality on !TypeRep).
    33
    4 I suggest that the TyCon be enhanced to contain a qualified name, but that the current API be maintained, except for adding some new functions to access qualified name.
     4I suggest that the !TyCon be enhanced to contain a qualified name, but that the current API be maintained, except for adding some new functions to access qualified name.
    55
    66If prodded I could provide the Data.Typeable implementation and the fix to ghc.