@@ -70,10 +70,8 @@ module Data.Hashable
70
70
, unhashed
71
71
) where
72
72
73
- import Data.String (IsString (.. ))
74
- import Data.Typeable (Typeable )
75
- import Data.Foldable (Foldable (foldr ))
76
73
import Data.Hashable.Class
74
+
77
75
#ifdef GENERICS
78
76
import Data.Hashable.Generic ()
79
77
#endif
@@ -212,32 +210,3 @@ import Data.Hashable.Generic ()
212
210
-- > hashWithSalt s (Months n) = s `hashWithSalt`
213
211
-- > (2::Int) `hashWithSalt` n
214
212
215
- -- | A hashable value along with the result of the 'hash' function.
216
- data Hashed a = Hashed a {- # UNPACK #-} !Int
217
- deriving (Typeable ,Show )
218
-
219
- -- | Wrap a hashable value, caching the 'hash' function result.
220
- hashed :: Hashable a => a -> Hashed a
221
- hashed a = Hashed a (hash a)
222
-
223
- -- | Unwrap hashed value.
224
- unhashed :: Hashed a -> a
225
- unhashed (Hashed a _) = a
226
-
227
- -- | Uses precomputed hash to detect inequality faster
228
- instance Eq a => Eq (Hashed a ) where
229
- Hashed a ha == Hashed b hb = ha == hb && a == b
230
-
231
- instance Ord a => Ord (Hashed a ) where
232
- Hashed a _ `compare` Hashed b _ = a `compare` b
233
-
234
- instance Hashable a => Hashable (Hashed a ) where
235
- hashWithSalt = defaultHashWithSalt
236
- hash (Hashed _ h) = h
237
-
238
- instance (IsString a , Hashable a ) => IsString (Hashed a ) where
239
- fromString s = let r = fromString s in Hashed r (hash r)
240
-
241
- instance Foldable Hashed where
242
- foldr f acc (Hashed a _) = f a acc
243
-
0 commit comments