
5 Feb
2007
5 Feb
'07
1:11 p.m.
Hi all, I'm trying to create a function which filters out all number from a list that are divisible by an integer. Ex. the list [2,3,4,5,6] div 2...should give me the list like: [3,5], other numbers should be removed divisible by 2. filter :: (a -> Bool) -> [a] -> [a] filter p [] = [] filter p (x:xs) = if p 'mod' x then x : filter p xs else filter p xs I tried this, but it doesn't work!!!! Thank You, Miranda