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
__________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com _______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
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
participants (2)
-
bracaman -
Zhanyong Wan