Permalink
Browse files

hashable 1.2 support

  • Loading branch information...
1 parent 9728707 commit 94dae9df01d153c6e2ff35d12ff033518868098b @ekmett committed Dec 14, 2012
Showing with 8 additions and 8 deletions.
  1. +3 −3 Data/Interned/IntSet.hs
  2. +2 −2 Data/Interned/Internal/String.hs
  3. +1 −1 Data/Interned/Internal/Text.hs
  4. +2 −2 intern.cabal
View
@@ -202,9 +202,9 @@ instance Interned IntSet where
cache = intSetCache
instance Hashable (Description IntSet) where
- hash DNil = 0
- hash (DTip n) = 1 `hashWithSalt` n
- hash (DBin p m l r) = hash p `hashWithSalt` m `hashWithSalt` l `hashWithSalt` r
+ hashWithSalt s DNil = s `hashWithSalt` (0 :: Int)
+ hashWithSalt s (DTip n) = s `hashWithSalt` (1 :: Int) `hashWithSalt` n
+ hashWithSalt s (DBin p m l r) = s `hashWithSalt` (2 :: Int) `hashWithSalt` p `hashWithSalt` m `hashWithSalt` l `hashWithSalt` r
intSetCache :: Cache IntSet
intSetCache = mkCache
@@ -38,8 +38,8 @@ instance Uninternable InternedString where
unintern = uninternString
instance Hashable (Description InternedString) where
- hash (Cons c s) = foldl' hashWithSalt (hashWithSalt 0 c) s
- hash Nil = 0
+ hashWithSalt s (Cons c cs) = foldl' hashWithSalt (hashWithSalt s c) cs
+ hashWithSalt s Nil = s `hashWithSalt` (0 :: Int)
stringCache :: Cache InternedString
stringCache = mkCache
@@ -36,7 +36,7 @@ instance Uninternable InternedText where
unintern (InternedText _ b) = b
instance Hashable (Description InternedText) where
- hash (DT h) = hash h
+ hashWithSalt s (DT h) = hashWithSalt s h
itCache :: Cache InternedText
itCache = mkCache
View
@@ -1,6 +1,6 @@
name: intern
category: Data, Data Structures
-version: 0.9.1
+version: 0.9.1.1
license: BSD3
cabal-version: >= 1.6
license-file: LICENSE
@@ -47,7 +47,7 @@ library
base >= 4 && < 5,
bytestring >= 0.9 && < 0.11,
text == 0.11.*,
- hashable == 1.1.*,
+ hashable >= 1.1 && < 1.3,
unordered-containers >= 0.2.1 && < 0.3,
array >= 0.3 && < 0.5

0 comments on commit 94dae9d

Please sign in to comment.