Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make library compile with hashable-1.2

  • Loading branch information...
commit f7d4d97eb1e40a6bf9aa6c1a0f6ceceb24dd0580 1 parent bb8c6e4
@tibbe authored
View
6 tests/HashMapProperties.hs
@@ -7,7 +7,7 @@ module Main (main) where
import qualified Data.Foldable as Foldable
import Data.Function (on)
-import Data.Hashable (Hashable(hash))
+import Data.Hashable (Hashable(hashWithSalt))
import qualified Data.List as L
#if defined(STRICT)
import qualified Data.HashMap.Strict as HM
@@ -24,7 +24,7 @@ newtype Key = K { unK :: Int }
deriving (Arbitrary, Eq, Ord, Show)
instance Hashable Key where
- hash k = hash (unK k) `mod` 20
+ hashWithSalt salt k = hashWithSalt salt (unK k) `mod` 20
------------------------------------------------------------------------
-- * Properties
@@ -67,7 +67,7 @@ newtype AlwaysCollide = AC Int
deriving (Arbitrary, Eq, Ord, Show)
instance Hashable AlwaysCollide where
- hash _ = 1
+ hashWithSalt _ _ = 1
-- White-box test that tests the case of deleting one of two keys from
-- a map, where the keys' hash values collide.
View
4 tests/HashSetProperties.hs
@@ -6,7 +6,7 @@
module Main (main) where
import qualified Data.Foldable as Foldable
-import Data.Hashable (Hashable(hash))
+import Data.Hashable (Hashable(hashWithSalt))
import qualified Data.List as L
import qualified Data.HashSet as S
import qualified Data.Set as Set
@@ -19,7 +19,7 @@ newtype Key = K { unK :: Int }
deriving (Arbitrary, Enum, Eq, Integral, Num, Ord, Show, Real)
instance Hashable Key where
- hash k = hash (unK k) `mod` 20
+ hashWithSalt salt k = hashWithSalt salt (unK k) `mod` 20
------------------------------------------------------------------------
-- * Properties
View
4 tests/Strictness.hs
@@ -3,7 +3,7 @@
module Main (main) where
-import Data.Hashable (Hashable(hash))
+import Data.Hashable (Hashable(hashWithSalt))
import Test.ChasingBottoms.IsBottom
import Test.Framework (Test, defaultMain, testGroup)
import Test.Framework.Providers.QuickCheck2 (testProperty)
@@ -17,7 +17,7 @@ newtype Key = K { unK :: Int }
deriving (Arbitrary, Eq, Ord, Show)
instance Hashable Key where
- hash k = hash (unK k) `mod` 20
+ hashWithSalt salt k = hashWithSalt salt (unK k) `mod` 20
instance (Arbitrary k, Arbitrary v, Eq k, Hashable k) =>
Arbitrary (HashMap k v) where
Please sign in to comment.
Something went wrong with that request. Please try again.