Permalink
Browse files

src/ehc: port to hashable-1.2

'combine' is gone away, but hashWithSalt is a drop-in replacement.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
1 parent 3c7686c commit 62cfab386910187d2620775bc4eb446772a4883a @trofi trofi committed Nov 22, 2013
Showing with 8 additions and 8 deletions.
  1. +1 −1 EHC/configure
  2. +1 −1 EHC/configure.ac
  3. +5 −5 EHC/src/ehc/Base/HsName.chs
  4. +1 −1 EHC/src/ehc/Base/UID.chs
View
@@ -3798,7 +3798,7 @@ HADDOCK_VERSION=$haddockVersion
# GHC version dependencies: packages passed as option, cabal packages
-cabal_base_lib_depends="base mtl fgl directory hashable>=1.1&&<1.2 uhc-util>=0.1.1"
+cabal_base_lib_depends="base mtl fgl directory hashable>=1.2&&<1.3 uhc-util>=0.1.1"
if test x$enableClr = "xyes"
then
cabal_base_lib_depends="$cabal_base_lib_depends language-cil"
View
@@ -415,7 +415,7 @@ AC_SUBST(HADDOCK_CMD,$haddockCmd)
AC_SUBST(HADDOCK_VERSION, $haddockVersion)
# GHC version dependencies: packages passed as option, cabal packages
-cabal_base_lib_depends="base mtl fgl directory hashable>=1.1&&<1.2 uhc-util>=0.1.1"
+cabal_base_lib_depends="base mtl fgl directory hashable>=1.2&&<1.3 uhc-util>=0.1.1"
if test x$enableClr = "xyes"
then
cabal_base_lib_depends="$cabal_base_lib_depends language-cil"
@@ -213,18 +213,18 @@ hsnUniqifyEval = hsnUniqify HsNameUniqifier_Evaluated
hsnHashWithSalt :: Int -> HsName -> Int
hsnHashWithSalt salt (HsName_Base s ) = hashWithSalt salt s
hsnHashWithSalt salt (HsName_Pos p ) = hashWithSalt salt p
-hsnHashWithSalt salt (HsName_Modf _ q b u) = hashWithSalt salt q `combine` hashWithSalt salt b `combine` hashWithSalt salt (Map.toList u)
-hsnHashWithSalt salt (HNmNr i n ) = i `combine` hashWithSalt salt n
+hsnHashWithSalt salt (HsName_Modf _ q b u) = hashWithSalt salt q `hashWithSalt` hashWithSalt salt b `hashWithSalt` hashWithSalt salt (Map.toList u)
+hsnHashWithSalt salt (HNmNr i n ) = i `hashWithSalt` hashWithSalt salt n
instance Hashable HsName where
hashWithSalt salt n@(HsName_Modf h _ _ _) | h /= 0 = h
hashWithSalt salt n = hsnHashWithSalt salt n
instance Hashable OrigName where
hashWithSalt salt (OrigNone ) = salt
- hashWithSalt salt (OrigLocal n) = 23 `combine` hashWithSalt salt n
- hashWithSalt salt (OrigGlobal n) = 19 `combine` hashWithSalt salt n
- hashWithSalt salt (OrigFunc n) = 17 `combine` hashWithSalt salt n
+ hashWithSalt salt (OrigLocal n) = 23 `hashWithSalt` hashWithSalt salt n
+ hashWithSalt salt (OrigGlobal n) = 19 `hashWithSalt` hashWithSalt salt n
+ hashWithSalt salt (OrigFunc n) = 17 `hashWithSalt` hashWithSalt salt n
instance Hashable HsNameUnique where
hashWithSalt salt (HsNameUnique_None ) = salt
@@ -64,7 +64,7 @@ instance Show UID where
%%[99
instance Hashable UID where
- hashWithSalt salt (UID h _) = salt `combine` h
+ hashWithSalt salt (UID h _) = salt `hashWithSalt` h
%%]
%%[1.UID.mkNewLevUID

0 comments on commit 62cfab3

Please sign in to comment.