:: (a -> Bool) -> [a] -> [a] -package:extra -package:prelude-compat -package:Cabal -package:utility-ht package:dimensional

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]