diff --git a/Options.hs b/Options.hs index 6cb04a4d2..dfb795e8d 100644 --- a/Options.hs +++ b/Options.hs @@ -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 diff --git a/tools/bench.hs b/tools/bench.hs index d67da3890..3739516f1 100644 --- a/tools/bench.hs +++ b/tools/bench.hs @@ -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