Ticket #4108 (closed bug: fixed)
GHC.Integer.hashInteger is a misnomer and confuses people
| Reported by: | duncan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.0.1 |
| Component: | Compiler | Version: | 6.12.2 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
GHC.Integer.hashInteger from the integer-gmp package does not hash Integers. 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.
Change History
Note: See
TracTickets for help on using
tickets.
