summaryrefslogtreecommitdiff
path: root/Types
diff options
context:
space:
mode:
Diffstat (limited to 'Types')
-rw-r--r--Types/Key.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Types/Key.hs b/Types/Key.hs
index 553fd8f3d..7f9f514c7 100644
--- a/Types/Key.hs
+++ b/Types/Key.hs
@@ -26,6 +26,7 @@ import System.Posix.Types
import Common
import Utility.QuickCheck
+import Utility.Bloom
{- A Key has a unique name, which is derived from a particular backend,
- and may contain other optional metadata. -}
@@ -130,6 +131,10 @@ instance Arbitrary Key where
<*> ((abs <$>) <$> arbitrary) -- chunksize cannot be negative
<*> ((succ . abs <$>) <$> arbitrary) -- chunknum cannot be 0 or negative
+instance Hashable Key where
+ hashIO32 = hashIO32 . show
+ hashIO64 = hashIO64 . show
+
prop_idempotent_key_encode :: Key -> Bool
prop_idempotent_key_encode k = Just k == (file2key . key2file) k