#880: someFunction :: TypeRep -> Int
------------------------------+---------------------------------------------
Reporter: guest | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: libraries/base | Version: 6.4.2
Severity: normal | Resolution:
Keywords: | Os: Unknown
Difficulty: Easy (1 hr) | Architecture: Unknown
------------------------------+---------------------------------------------
Old description:
> Now that TypeRep share their keys using RTS internal allocation, can we
> get a function in Data.Typeable (or even GHC.Exts) that retrieves the Int
> key? Currently my job code (OpenAFP) and Pugs both uses "show :: TypeRep
> -> String" as the key for Map, but I think it'd be much, much faster if
> either TypeRep supports Ord natively, or (preferably) that we can get a
> Int out of it.
>
> Thanks!
> Audrey
New description:
Now that {{{TypeRep}}} share their keys using RTS internal allocation, can
we get a function in {{{Data.Typeable}}} (or even {{{GHC.Exts}}}) that
retrieves the Int key? Currently my job code (OpenAFP) and Pugs both uses
{{{"show :: TypeRep -> String"}}} as the key for Map, but I think it'd be
much, much faster if either {{{TypeRep}}} supports Ord natively, or
(preferably) that we can get a Int out of it.
Thanks!
Audrey
Comment (by simonmar):
What do people think here? The options I can think of:
{{{unsafeTypeRepKey :: TypeRep -> Int}}}
Slightly dubious. This behaves like a function in any given run of the
program, but does not have a sensible semantics.
{{{typeRepKey :: TypeRep -> IO Int}}}
Less dubious, but perhaps less useful.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/880>
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