Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Data/HashMap/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,13 +1161,13 @@ filter p = filterWithKey (\_ v -> p v)
-- | /O(n)/ Return a list of this map's keys. The list is produced
-- lazily.
keys :: HashMap k v -> [k]
keys = L.map fst . toList
keys t = build (\ c z -> foldrWithKey (\ k _v ks -> c k ks) z t)
{-# INLINE keys #-}

-- | /O(n)/ Return a list of this map's values. The list is produced
-- lazily.
elems :: HashMap k v -> [v]
elems = L.map snd . toList
elems t = build (\ c z -> foldrWithKey (\ _k v vs -> c v vs) z t)
{-# INLINE elems #-}

------------------------------------------------------------------------
Expand Down