module Filter where import Prelude hiding (filter) -- Extract those elements from a list satisfying a given predicate -- -- Example: filter odd [1, 2, 3, 4, 5, 6] = [1, 3, 5] -- filter :: (a -> Bool) -> [a] -> [a] filter p [] = [] -- DELETE filter p (x:xs) | p x = x : filter p xs -- FOR THE | otherwise = filter p xs -- LECTURE