filter is:exact -package:aeson -package:unordered-containers -package:bytestring -package:containers -package:ghc -package:rio -package:hedgehog

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]

Examples

>>> filter odd [1, 2, 3]
[1,3]
>>> filter (\l -> length l > 3) ["Hello", ", ", "World", "!"]
["Hello","World"]
>>> filter (/= 3) [1, 2, 3, 4, 3, 2, 1]
[1,2,4,2,1]
filter p xs removes any elements from xs that do not satisfy p.
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
Keep only values in the stream passing a given predicate. Subject to fusion
Keep only values in the stream passing a given predicate. Subject to fusion Since 0.3.0
(filter predicate) only forwards values that satisfy the predicate.
filter (pure True) = cat

filter (liftA2 (&&) p1 p2) = filter p1 >-> filter p2

filter f = mapMaybe (\a -> a <$ guard (f a))
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]
Drops chunks from an input stream if they fail to match a given filter predicate. See filter. Items pushed back to the returned stream are propagated back upstream. Example:
ghci> Streams.fromList ["the", "quick", "brown", "fox"] >>=
Streams.filter (/= "brown") >>= Streams.toList
["the","quick","fox"]
Skip elements of a stream that fail a predicate
filter given a predicate returns a sequence of all elements that satisfy the predicate.
> filter (< 5) [1 .. 10]
[1,2,3,4]
Keep all values that satisfy the given predicate
>>> filter even (fromList [("C",3),("B",2),("A",1)])
fromList [("B",2)]

>>> filter odd (fromList [("C",3),("B",2),("A",1)])
fromList [("C",3),("A",1)]
Remove characters from ShortText which don't satisfy given predicate.
>>> filter (`notElem` ['a','e','i','o','u']) "You don't need vowels to convey information!"
"Y dn't nd vwls t cnvy nfrmtn!"
filter (const False) t == ""
filter (const True) t == t
length (filter p t) <= length t
filter p t == pack [ c | c <- unpack t, p c ]
Only allows Word8s to pass if they satisfy the predicate
O(n). Filter all association pairs that satisfy the predicate. Note that the predicate will be applied twice for each association in the bimap. Version: 0.2.4
O(n) filter, applied to a predicate and a ByteStream, returns a ByteStream containing those characters that satisfy the predicate.
O(n) filter, applied to a predicate and a ByteStream, returns a ByteStream containing those characters that satisfy the predicate.
filter f . filter g ≡ filter (liftA2 (&&) g f)
Returns only the elements that satisfy the function.
O(n) filter, applied to a predicate and a JSString, returns a JSString containing those characters that satisfy the predicate.
O(n). 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]