Skip to content

Commit 5cdf332

Browse files
authored
Add disclaimer to D.HS.toList (#507)
...and improve the disclaimer for D.HM.toList. Fixes #481.
1 parent 7310538 commit 5cdf332

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
@@ -466,7 +466,7 @@ instance Ord k => Ord1 (HashMap k) where
466466

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

@@ -2228,7 +2228,8 @@ elems = List.map snd . toList
22282228
-- ** Lists
22292229

22302230
-- | \(O(n)\) Return a list of this map's elements. The list is
2231-
-- produced lazily. The order of its elements is unspecified.
2231+
-- produced lazily. The order of its elements is unspecified, and it may
2232+
-- change from version to version of either this package or of @hashable@.
22322233
toList :: HashMap k v -> [(k, v)]
22332234
toList t = Exts.build (\ c z -> foldrWithKey (curry c) z t)
22342235
{-# 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)