30 May
2001
30 May
'01
9:15 p.m.
Tom Pledger wrote:
Zhanyong Wan writes: : | I can't help wondering why it isn't | | deleteBy' :: (a -> Bool) -> [a] -> [a] | deleteBy' f [] = [] | deleteBy' f (y:ys) = if f y then ys else | y : deleteBy' f ys
deleteBy'' f = filter (not . f)
No. deleteBy' f only deletes the *first* element that satisfies the predicate f, while filter (not . f) deletes *all* such elements. -- Zhanyong