-- (lookup_str "foo") looks for the flag -foo=X or -fooX,
-- and returns the string X
lookup_str sw
- = case firstJust (map (startsWith sw) staticFlags) of
+ = case firstJust (map (maybePrefixMatch sw) staticFlags) of
Just ('=' : str) -> Just str
Just str -> Just str
Nothing -> Nothing
"funfolding-keeness-factor"
]
-
-
--- Misc functions for command-line options
-
-startsWith :: String -> String -> Maybe String
--- startsWith pfx (pfx++rest) = Just rest
-
-startsWith [] str = Just str
-startsWith (c:cs) (s:ss)
- = if c /= s then Nothing else startsWith cs ss
-startsWith _ [] = Nothing
-
-
-----------------------------------------------------------------------------
-- convert sizes like "3.5M" into integers
, "-package concurrent" ]),
(WayNDP, Way "ndp" False "Nested data parallelism"
- [ "-fparr"
+ [ "-XParr"
, "-fvectorise"]),
(WayUser_a, Way "a" False "User way 'a'" ["$WAY_a_REAL_OPTS"]),