(no subject)

Zhanyong Wan zhanyong.wan@yale.edu
Thu, 07 Feb 2002 16:08:55 -0500


bracaman wrote:

> If you can use elem :: Eq a => a -> [a] -> Bool  function, you can do:
>
> f x l= or (map (elem x) l
>
> On Thursday 07 February 2002 20:17, you wrote:
> > hi,how do I define a function to test whether a number
> > is an element of a list of lists of numbers.
> >
> > elem :: Int -> [[Int]] -> Bool

I prefer

f x l = x `elem` concat l

- Zhanyong Wan