[GHC] #4108: GHC.Integer.hashInteger is a misnomer and confuses
people
GHC
cvs-ghc at haskell.org
Sun May 30 17:51:49 EDT 2010
#4108: GHC.Integer.hashInteger is a misnomer and confuses people
---------------------------------+------------------------------------------
Reporter: duncan | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.12.2 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
`GHC.Integer.hashInteger` from the integer-gmp package does not hash
`Integer`s. It extracts the first `Int` from an `Integer` which might
possibly be a useful utility in a hash function (it is used in
`Data.Unique.hashUnique`).
The fact this function has this name makes people tempted to use it. This
is a bad thing. There is at least one package on hackage using this (name
withheld to protect the guilty).
The function should be renamed to reflect what it actually does. The fact
that this might break programs using this function should be seen as a
bonus.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4108>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list