GHC.Integer.hashInteger is a misnomer and confuses people
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.
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |