bracketOnError, while, forever

Tomasz Zielonka tomasz.zielonka at gmail.com
Thu Feb 10 13:03:27 EST 2005


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

How about

    any (x `eq`) ys

?

Best regards
Tomasz

-- 
Szukamy programisty C++ i Haskell'a: http://tinyurl.com/5mw4e


More information about the Libraries mailing list