#3480: Easily make Typeable keys pure, so that Typeable can be handled
efficiently across communications
---------------------------------+------------------------------------------
Reporter: guest | Owner:
Type: task | Status: new
Priority: normal | Component: libraries/base
Version: | Severity: trivial
Keywords: Typeable, efficiency | Testcase:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
---------------------------------+------------------------------------------
Data.Typeable: Easily make Typeable keys pure(used in Eq), so that
Typeable keys don“t vary from run to run. This permits an efficient
storage of the keys in files and to be transmitted trough communications
as well as processed without loss of efficiency. Actually gaining
efficiency probably, since the keys caches are not necessary.
Currently, whenever the user needs to communicate types, he must transmit
the full string name for each type. Moreover, in the reception, the
programmer is forced to handle these full string keys for mapping types
to handlers, in equality checks etc. if the type keys are pure, the
efficiency of key handling can be keept across communications.
short description of task:
Istead of using a Hash( stringType, generatedKey) use hashString (string-
of-type)
Long description:
1) drop the cache
drop newKey
2) use instead the expression:
Key $ hashString str
whenever a new key is needed
from the package Data.HashTable:
hashString :: String -> Int
the key obtained is pure so:
3) drop the "IO" in typeRepKey signature
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3480>
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