Skip to content

Commit 8bb958e

Browse files
authored
Minor docs fixes (#452)
* Remove misplaced comment Seems like a copy-and-paste error * s/substitutivity/extensionality The Eq docs were reworded to use "extensionality" a while ago.
1 parent 9078dd5 commit 8bb958e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

Data/HashMap/Internal.hs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ import qualified Data.List as List
177177
import qualified GHC.Exts as Exts
178178
import qualified Language.Haskell.TH.Syntax as TH
179179

180-
-- | A set of values. A set cannot contain duplicate values.
181-
------------------------------------------------------------------------
182-
183180
-- | Convenience function. Compute a hash value for the given value.
184181
hash :: H.Hashable a => a -> Hash
185182
hash = fromIntegral . H.hash
@@ -400,7 +397,7 @@ instance Eq k => Eq1 (HashMap k) where
400397
liftEq = equal1
401398

402399
-- | Note that, in the presence of hash collisions, equal @HashMap@s may
403-
-- behave differently, i.e. substitutivity may be violated:
400+
-- behave differently, i.e. extensionality may be violated:
404401
--
405402
-- >>> data D = A | B deriving (Eq, Show)
406403
-- >>> instance Hashable D where hashWithSalt salt _d = salt
@@ -415,7 +412,7 @@ instance Eq k => Eq1 (HashMap k) where
415412
-- >>> toList y
416413
-- [(B,2),(A,1)]
417414
--
418-
-- In general, the lack of substitutivity can be observed with any function
415+
-- In general, the lack of extensionality can be observed with any function
419416
-- that depends on the key ordering, such as folds and traversals.
420417
instance (Eq k, Eq v) => Eq (HashMap k v) where
421418
(==) = equal1 (==)

Data/HashSet/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ instance NFData1 HashSet where
127127
liftRnf rnf1 = liftRnf2 rnf1 rnf . asMap
128128

129129
-- | Note that, in the presence of hash collisions, equal @HashSet@s may
130-
-- behave differently, i.e. substitutivity may be violated:
130+
-- behave differently, i.e. extensionality may be violated:
131131
--
132132
-- >>> data D = A | B deriving (Eq, Show)
133133
-- >>> instance Hashable D where hashWithSalt salt _d = salt
@@ -142,7 +142,7 @@ instance NFData1 HashSet where
142142
-- >>> toList y
143143
-- [B,A]
144144
--
145-
-- In general, the lack of substitutivity can be observed with any function
145+
-- In general, the lack of extensionality can be observed with any function
146146
-- that depends on the key ordering, such as folds and traversals.
147147
instance (Eq a) => Eq (HashSet a) where
148148
HashSet a == HashSet b = equalKeys a b

0 commit comments

Comments
 (0)