summaryrefslogtreecommitdiff
blob: 407b3616fa20490a98a56789a397e3817329d618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- Agda-2.3.2-orig/src/full/Agda/Syntax/Abstract/Name.hs	2012-11-12 11:25:21.000000000 +1100
+++ Agda-2.3.2/src/full/Agda/Syntax/Abstract/Name.hs	2012-12-18 22:10:22.241674353 +1100
@@ -239,8 +239,13 @@
   show x = show (nameConcrete x) -- ++ "|" ++ show (nameId x)
 
 instance Hashable Name where
+#if MIN_VERSION_hashable(1,2,0)
+  {-# INLINE hashWithSalt #-}
+  hashWithSalt salt = (hashWithSalt salt) . nameId
+#else
   {-# INLINE hash #-}
   hash = hash . nameId
+#endif
 
 instance Show QName where
   show q = concat $ intersperse "." $ map show $ qnameToList q
@@ -255,8 +260,13 @@
   compare = compare `on` qnameName
 
 instance Hashable QName where
+#if MIN_VERSION_hashable(1,2,0)
+  {-# INLINE hashWithSalt #-}
+  hashWithSalt salt = (hashWithSalt salt) . qnameName
+#else
   {-# INLINE hash #-}
   hash = hash . qnameName
+#endif
 
 instance HasRange Name where
   getRange = getRange . nameConcrete
--- Agda-2.3.2-orig/src/full/Agda/Syntax/Common.hs	2012-11-12 11:25:21.000000000 +1100
+++ Agda-2.3.2/src/full/Agda/Syntax/Common.hs	2012-12-18 22:11:29.730050687 +1100
@@ -272,8 +272,13 @@
   fromEnum (NameId n _) = fromIntegral n
 
 instance Hashable NameId where
+#if MIN_VERSION_hashable(1,2,0)
+  {-# INLINE hashWithSalt #-}
+  hashWithSalt salt (NameId n m) = hashWithSalt salt (n, m)
+#else
   {-# INLINE hash #-}
   hash (NameId n m) = hash (n, m)
+#endif
 
 newtype Constr a = Constr a
 
--- Agda-2.3.2-orig/src/full/Agda/Utils/Pointer.hs	2012-11-12 11:25:22.000000000 +1100
+++ Agda-2.3.2/src/full/Agda/Utils/Pointer.hs	2012-12-18 22:12:18.834049775 +1100
@@ -1,4 +1,4 @@
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable, CPP #-}
 module Agda.Utils.Pointer
   ( Ptr, newPtr, derefPtr, setPtr
   , updatePtr, updatePtrM
@@ -71,7 +71,11 @@
   compare = compare `on` ptrTag
 
 instance Hashable (Ptr a) where
+#if MIN_VERSION_hashable(1,2,0)
+  hashWithSalt salt = (hashWithSalt salt) . ptrTag
+#else
   hash = hash . ptrTag
+#endif
 
 instance NFData (Ptr a) where