Hlint: Warning: Use list comprehension

This commit is contained in:
marko.kocic 2009-09-23 09:45:39 +00:00
parent fd0969ad67
commit d6393f5f63
2 changed files with 5 additions and 5 deletions

View File

@ -113,16 +113,16 @@ data Opt =
-- these make me nervous
optsWithConstructor f opts = concatMap get opts
where get o = if f v == o then [o] else [] where v = value o
where get o = [o | f v == o] where v = value o
optsWithConstructors fs opts = concatMap get opts
where get o = if any (== o) fs then [o] else []
where get o = [o | any (== o) fs]
optValuesForConstructor f opts = concatMap get opts
where get o = if f v == o then [v] else [] where v = value o
where get o = [v | f v == o] where v = value o
optValuesForConstructors fs opts = concatMap get opts
where get o = if any (\f -> f v == o) fs then [v] else [] where v = value o
where get o = [v | any (\f -> f v == o) fs] where v = value o
-- | Parse the command-line arguments into options, command name, and
-- command arguments. Any dates in the options are converted to explicit

View File

@ -116,7 +116,7 @@ optValueWithDefault optcons def opts =
optValuesForConstructor :: (String -> Opt) -> [Opt] -> [String]
optValuesForConstructor optcons opts = concatMap get opts
where get o = if optcons v == o then [v] else [] where v = value o
where get o = [v | optcons v == o] where v = value o
main = do
args <- getArgs