filter -package:Cabal -package:bytestring -package:vector

filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]
>>> filter odd [1, 2, 3]
[1,3]
filter p xs removes any elements from xs that do not satisfy p.
O(n). Filter all values that satisfy some predicate.
filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty
filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
O(n). Filter all elements that satisfy some predicate.
O(n). Filter all values that satisfy the predicate.
filter (> "a") (fromList [(5,"a"), (3,"b")]) == singleton 3 "b"
filter (> "x") (fromList [(5,"a"), (3,"b")]) == empty
filter (< "a") (fromList [(5,"a"), (3,"b")]) == empty
The filter function takes a predicate p and a sequence xs and returns a sequence of those elements which satisfy the predicate.
O(n). Filter all elements that satisfy the predicate.
O(n) filter, applied to a predicate and a Text, returns a Text containing those characters that satisfy the predicate.
O(n) filter, applied to a predicate and a stream, returns a stream containing those characters that satisfy the predicate. Properties
unstream . filter p . stream = filter p
Filter this map by retaining only elements which values satisfy a predicate.
Filter this set by retaining only elements satisfying a predicate.
This generalizes the list-based filter function.
Filter the entries whose keys are missing from the other map using some Applicative action.
filterAMissing f = Merge.Lazy.traverseMaybeMissing $
\k x -> (\b -> guard b *> Just x) <$> f k x
but this should be a little faster.
Filter the entries whose keys are missing from the other map.
filterMissing :: (k -> x -> Bool) -> SimpleWhenMissing x x
filterMissing f = Merge.Lazy.mapMaybeMissing $ \k x -> guard (f k x) *> Just x
but this should be a little faster.
O(n). Filter all keys/values that satisfy some predicate.
filterWithKey (\k _ -> k > 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
Filter the entries whose keys are missing from the other map using some Applicative action.
filterAMissing f = Merge.Lazy.traverseMaybeMissing $
k x -> (b -> guard b *> Just x) $ f k x
but this should be a little faster.
Filter the entries whose keys are missing from the other map.
filterMissing :: (k -> x -> Bool) -> SimpleWhenMissing k x x
filterMissing f = Merge.Lazy.mapMaybeMissing $ \k x -> guard (f k x) *> Just x
but this should be a little faster.
O(n). Filter all keys/values that satisfy the predicate.
filterWithKey (\k _ -> k > 4) (fromList [(5,"a"), (3,"b")]) == singleton 5 "a"
Common implementation for filterWithKey and mapMaybeWithKey, allowing the former to former to reuse terms.
Filter this map by retaining only elements satisfying a predicate.
Filtering control message.
Filter elements of a primitive array according to a predicate.
Filter the primitive array, keeping the elements for which the monadic predicate evaluates true.
Filter the primitive array, keeping the elements for which the monadic predicate evaluates to true.