filter takes a predicate (function returning Bool) and a list; returns only the elements for which the predicate is True.
-- Keep only even numbers
filter even [1, 2, 3, 4, 5, 6]
-- Result: [2, 4, 6]
-- Keep numbers greater than 3
filter (>3) [1, 2, 3, 4, 5]
-- Result: [4, 5]