summaryrefslogtreecommitdiff
path: root/libraries/integer-simple
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-01-03 12:04:27 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-01-03 12:04:27 +0100
commit2a28fded5fc65e50c171637035d914472cce0273 (patch)
tree22daffb6d9dee91c0edc7de14a1196d286142f8e /libraries/integer-simple
parent994ea5b6db55fb32199fc49ab83b62cb21cedd69 (diff)
downloadhaskell-2a28fded5fc65e50c171637035d914472cce0273.tar.gz
Use a more sensible `hashInteger` implementation
This makes `hashInteger` behave the same way as `integer-gmp`s `hashInteger`. Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'libraries/integer-simple')
-rw-r--r--libraries/integer-simple/GHC/Integer/Type.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/libraries/integer-simple/GHC/Integer/Type.hs b/libraries/integer-simple/GHC/Integer/Type.hs
index 144a52c701..5deecd29bb 100644
--- a/libraries/integer-simple/GHC/Integer/Type.hs
+++ b/libraries/integer-simple/GHC/Integer/Type.hs
@@ -503,10 +503,9 @@ signumInteger (Negative _) = negativeOneInteger
signumInteger Naught = Naught
signumInteger (Positive _) = oneInteger
--- XXX This isn't a great hash function
{-# NOINLINE hashInteger #-}
hashInteger :: Integer -> Int#
-hashInteger (!_) = 42#
+hashInteger = integerToInt
-------------------------------------------------------------------
-- The hard work is done on positive numbers