@@ -199,15 +199,18 @@ instance IsString Value where
199199 fromString = String . pack
200200 {-# INLINE fromString #-}
201201
202+hashValue :: Int -> Value -> Int
203+hashValue s (Object o) = H.foldl' hashWithSalt
204+ (s `hashWithSalt` (0::Int)) o
205+hashValue s (Array a) = V.foldl' hashWithSalt
206+ (s `hashWithSalt` (1::Int)) a
207+hashValue s (String str) = s `hashWithSalt` (2::Int) `hashWithSalt` str
208+hashValue s (Number n) = s `hashWithSalt` (3::Int) `hashWithSalt` n
209+hashValue s (Bool b) = s `hashWithSalt` (4::Int) `hashWithSalt` b
210+hashValue s Null = s `hashWithSalt` (5::Int)
211+
202212instance Hashable Value where
203− hashWithSalt s (Object o) = H.foldl' hashWithSalt
204− (s `hashWithSalt` (0::Int)) o
205− hashWithSalt s (Array a) = V.foldl' hashWithSalt
206− (s `hashWithSalt` (1::Int)) a
207− hashWithSalt s (String str) = s `hashWithSalt` (2::Int) `hashWithSalt` str
208− hashWithSalt s (Number n) = s `hashWithSalt` (3::Int) `hashWithSalt` n
209− hashWithSalt s (Bool b) = s `hashWithSalt` (4::Int) `hashWithSalt` b
210− hashWithSalt s Null = s `hashWithSalt` (5::Int)
213+ hashWithSalt = hashValue
211214
212215-- | The empty array.
213216emptyArray :: Value