Skip to content

Commit 3395f00

Browse files
committed
Add disclaimer to D.HS.toList
...and improve the disclaimer for D.HM.toList. Fixes #481.
1 parent 8e380a6 commit 3395f00

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Data/HashMap/Internal.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ instance Ord k => Ord1 (HashMap k) where
464464

465465
-- | The ordering is total and consistent with the `Eq` instance. However,
466466
-- nothing else about the ordering is specified, and it may change from
467-
-- version to version of either this package or of hashable.
467+
-- version to version of either this package or of @hashable@.
468468
instance (Ord k, Ord v) => Ord (HashMap k v) where
469469
compare = cmp compare compare
470470

@@ -2224,7 +2224,8 @@ elems = List.map snd . toList
22242224
-- ** Lists
22252225

22262226
-- | \(O(n)\) Return a list of this map's elements. The list is
2227-
-- produced lazily. The order of its elements is unspecified.
2227+
-- produced lazily. The order of its elements is unspecified, and it may
2228+
-- change from version to version of either this package or of @hashable@.
22282229
toList :: HashMap k v -> [(k, v)]
22292230
toList t = Exts.build (\ c z -> foldrWithKey (curry c) z t)
22302231
{-# INLINE toList #-}

Data/HashSet/Internal.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ filter p = HashSet . H.filterWithKey q . asMap
439439
{-# INLINE filter #-}
440440

441441
-- | \(O(n)\) Return a list of this set's elements. The list is
442-
-- produced lazily.
442+
-- produced lazily. The order of its elements is unspecified, and it may
443+
-- change from version to version of either this package or of @hashable@.
443444
toList :: HashSet a -> [a]
444445
toList t = Exts.build (\ c z -> foldrWithKey (const . c) z (asMap t))
445446
{-# INLINE toList #-}

0 commit comments

Comments
 (0)