File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -790,6 +790,8 @@ infixl 9 !
790790-- if present, otherwise return 'Nothing'.
791791--
792792-- This function can be used for /interning/, i.e. to reduce memory usage.
793+ --
794+ -- @since 0.2.21
793795lookupKey :: Hashable k => k -> HashMap k v -> Maybe k
794796lookupKey k = \ m -> fromMaybe# (lookupKeyInSubtree# 0 (hash k) k m)
795797 where
@@ -1972,6 +1974,8 @@ differenceWith f = differenceWithKey (const f)
19721974-- encountered, the combining function is applied to the values of these keys.
19731975-- If it returns 'Nothing', the element is discarded (proper set difference). If
19741976-- it returns (@'Just' y@), the element is updated with a new value @y@.
1977+ --
1978+ -- @since 0.2.21
19751979differenceWithKey :: Eq k => (k -> v -> w -> Maybe v ) -> HashMap k v -> HashMap k w -> HashMap k v
19761980differenceWithKey f = go_differenceWithKey 0
19771981 where
@@ -2323,7 +2327,7 @@ searchSwap mary n toFind start = go start toFind start
23232327-- xs ``disjoint`` ys = null (xs ``intersection`` ys)
23242328-- @
23252329--
2326- -- @since FIXME
2330+ -- @since 0.2.21
23272331disjoint :: Eq k => HashMap k a -> HashMap k b -> Bool
23282332disjoint = disjointSubtrees 0
23292333{-# INLINE disjoint #-}
Original file line number Diff line number Diff line change @@ -632,6 +632,8 @@ differenceWith f = HM.differenceWithKey $
632632-- encountered, the combining function is applied to the values of these keys.
633633-- If it returns 'Nothing', the element is discarded (proper set difference). If
634634-- it returns (@'Just' y@), the element is updated with a new value @y@.
635+ --
636+ -- @since 0.2.21
635637differenceWithKey :: Eq k => (k -> v -> w -> Maybe v ) -> HashMap k v -> HashMap k w -> HashMap k v
636638differenceWithKey f = HM. differenceWithKey $
637639 \ k vA vB -> case f k vA vB of
Original file line number Diff line number Diff line change @@ -356,6 +356,8 @@ member a s = case H.lookup a (asMap s) of
356356-- present, otherwise return 'Nothing'.
357357--
358358-- This is useful for /interning/, i.e. to reduce memory usage.
359+ --
360+ -- @since 0.2.21
359361lookupElement :: Hashable a => a -> HashSet a -> Maybe a
360362lookupElement a = H. lookupKey a . asMap
361363{-# INLINE lookupElement #-}
@@ -412,7 +414,7 @@ intersection (HashSet a) (HashSet b) = HashSet (H.intersection a b)
412414-- xs ``disjoint`` ys = null (xs ``intersection`` ys)
413415-- @
414416--
415- -- @since FIXME
417+ -- @since 0.2.21
416418disjoint :: Eq k => HashSet k -> HashSet k -> Bool
417419disjoint (HashSet a) (HashSet b) = H. disjoint a b
418420{-# INLINE disjoint #-}
You can’t perform that action at this time.
0 commit comments