Hi
filter :: (a -> Bool) -> [a] -> [a]
filter f = foldr (\x -> \xs -> if (f x) then (x:xs) else xs) []
Somehow I feel this could be done more elegantly. What does the list think?
Thanks, Paul

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to