Re: [Haskell-cafe] Rewriting filter with foldr

30 Sep
2007
30 Sep
'07
1:52 p.m.
The question is asking for a new definition of filter using foldr. Sorry, I should have mentioned that before. Cheers, Paul At 14:26 30/09/2007, you wrote:
Perhaps a list comprehension better shows the intention of the filter function:
filter p xs = [x | x <- xs, p x]
You can literally read that as "take all x from xs that satisfy p".
6491
Age (days ago)
6491
Last active (days ago)
0 comments
1 participants
participants (1)
-
PR Stanley