This problem could be solved step by step:
define a function to check wether there is any occurrence of any character of a string in another string
isInclude es xs = or $ map (\e -> e `elem` xs) es
for every element in
es
you want to check, such as '*', '-', or '+', if it occurs inxs
, that lambda abstraction(\e -> e
elemxs)
will return true. If any of that lambda abstractions is true,isInclude
will be true.That
isInclude
can also be implemented like thisisInclude es xs = or $ map (flip elem xs) es
or
isInclude es xs = or $ map (`elem` xs) es
now you can find out all those strings in a list of string that do not include any of these characters
filter (not . isInclude "*-+") ls
here
ls
is a list of stringfinally, you can
map
toLower
fromData.Char
to every string to convert its characters to lower caselist3 ls = map (map toLower) $ filter (not . isInclude "*-+") ls