Skip to content
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions containers/src/Data/IntMap/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2747,7 +2747,7 @@ mapKeysMonotonic f t =
{--------------------------------------------------------------------
Filter
--------------------------------------------------------------------}
-- | \(O(n)\). Filter all values that satisfy some predicate.
-- | \(O(n)\). Keep all values that satisfy some predicate.
--
-- > filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
-- > filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty
Expand All @@ -2757,7 +2757,7 @@ filter :: (a -> Bool) -> IntMap a -> IntMap a
filter p m
= filterWithKey (\_ x -> p x) m

-- | \(O(n)\). Filter all keys that satisfy some predicate.
-- | \(O(n)\). Keep all keys that satisfy some predicate.
--
-- @
-- filterKeys p = 'filterWithKey' (\\k _ -> p k)
Expand All @@ -2770,7 +2770,7 @@ filter p m
filterKeys :: (Key -> Bool) -> IntMap a -> IntMap a
filterKeys predicate = filterWithKey (\k _ -> predicate k)

-- | \(O(n)\). Filter all keys\/values that satisfy some predicate.
-- | \(O(n)\). Keep all keys\/values that satisfy some predicate.
--
-- > filterWithKey (\k _ -> k > 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"

Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/IntSet/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ disjoint Nil _ = True
{--------------------------------------------------------------------
Filter
--------------------------------------------------------------------}
-- | \(O(n)\). Filter all elements that satisfy some predicate.
-- | \(O(n)\). Keep all elements that satisfy some predicate.
filter :: (Key -> Bool) -> IntSet -> IntSet
filter predicate t
= case t of
Expand Down
6 changes: 3 additions & 3 deletions containers/src/Data/Map/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2785,7 +2785,7 @@ isProperSubmapOfBy f t1 t2
{--------------------------------------------------------------------
Filter and partition
--------------------------------------------------------------------}
-- | \(O(n)\). Filter all values that satisfy the predicate.
-- | \(O(n)\). Keep all values that satisfy the predicate.
--
-- > filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
-- > filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty
Expand All @@ -2795,7 +2795,7 @@ filter :: (a -> Bool) -> Map k a -> Map k a
filter p m
= filterWithKey (\_ x -> p x) m

-- | \(O(n)\). Filter all keys that satisfy the predicate.
-- | \(O(n)\). Keep all keys that satisfy the predicate.
--
-- @
-- filterKeys p = 'filterWithKey' (\\k _ -> p k)
Expand All @@ -2808,7 +2808,7 @@ filter p m
filterKeys :: (k -> Bool) -> Map k a -> Map k a
filterKeys p m = filterWithKey (\k _ -> p k) m

-- | \(O(n)\). Filter all keys\/values that satisfy the predicate.
-- | \(O(n)\). Keep all keys\/values that satisfy the predicate.
--
-- > filterWithKey (\k _ -> k > 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"

Expand Down
2 changes: 1 addition & 1 deletion containers/src/Data/Set/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ symmetricDifference (Bin _ x l1 r1) t2
{--------------------------------------------------------------------
Filter and partition
--------------------------------------------------------------------}
-- | \(O(n)\). Filter all elements that satisfy the predicate.
-- | \(O(n)\). Keep all elements that satisfy the predicate.
filter :: (a -> Bool) -> Set a -> Set a
filter _ Tip = Tip
filter p t@(Bin _ x l r)
Expand Down
Loading