Skip to content

Commit 9c7f237

Browse files
authored
Document additional guarantee of Arg's Hashable instance
Fixes haskell-unordered-containers#242.
1 parent 747ff1b commit 9c7f237

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Data/Hashable/Class.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,8 @@ instance Hashable a => Hashable (Max a) where
906906
hashWithSalt p (Max a) = hashWithSalt p a
907907

908908
-- | __Note__: Prior to @hashable-1.3.0.0@ the hash computation included the second argument of 'Arg' which wasn't consistent with its 'Eq' instance.
909+
-- Additionally, as of @hashable-1.3.0.0@, and going forward as part of the API guarantee, the hash of @'Arg' a _@ is the same value as the hash of @a@.
910+
-- This means that it's safe to add and remove 'Arg' from elements stored in hash-indexed data structures without changing any hashes.
909911
--
910912
-- @since 1.3.0.0
911913
instance Hashable a => Hashable (Arg a b) where

0 commit comments

Comments
 (0)