
25 Jan
2011
25 Jan
'11
11:43 p.m.
At 9:34 PM -0500 1/25/11, Tom Murphy wrote:
Hi everyone, Any suggestions?
Given that
someList :: [(a,b,String)]
, the expression
(_, _, "Tom") `elem` someList
seems so intuitive that, even though it doesn't work, I've been searching for several hours for something similar.
Do any of you know a way I can pull this off? I know there are plenty of ways to get the functionality, but something similarly intuitive and succinct would be great.
Thanks for the help, Tom
Wildcards (the underscores) can appear only in patterns. You could use a list comprehension, something like: (not . null) [ () | (_, _, "Tom") <- someList ] Dean