
10 Feb
2005
10 Feb
'05
1:05 p.m.
On Thu, Feb 10, 2005 at 05:56:09PM +0000, Malcolm Wallace wrote:
Here's another common function I use all the time, which appears to be missing from Data.List:
elemBy :: (a -> a -> Bool) -> a -> [a] -> Bool elemBy eq _ [] = False elemBy eq x (y:ys) = x `eq` y || elemBy eq x ys
Section 17.6 of the Report: "The library does not provide elemBy, because any (eq x) does the same job as elemBy eq x would."