Commit 74062336 authored by simonmar's avatar simonmar
Browse files

[project @ 2000-06-20 15:26:34 by simonmar]

remove duplicates from the list of ways, so that eg. ghc -prof -prof
is legal.
parent 853cec45
......@@ -1629,13 +1629,13 @@ opts =
, ( "no-recomp" , NoArg (writeIORef recomp False) )
------- ways --------------------------------------------------------
, ( "prof" , NoArg (add ways WayProf) )
, ( "unreg" , NoArg (add ways WayUnreg) )
, ( "ticky" , NoArg (add ways WayTicky) )
, ( "parallel" , NoArg (add ways WayPar) )
, ( "gransim" , NoArg (add ways WayGran) )
, ( "smp" , NoArg (add ways WaySMP) )
, ( "debug" , NoArg (add ways WayDebug) )
, ( "prof" , NoArg (addNoDups ways WayProf) )
, ( "unreg" , NoArg (addNoDups ways WayUnreg) )
, ( "ticky" , NoArg (addNoDups ways WayTicky) )
, ( "parallel" , NoArg (addNoDups ways WayPar) )
, ( "gransim" , NoArg (addNoDups ways WayGran) )
, ( "smp" , NoArg (addNoDups ways WaySMP) )
, ( "debug" , NoArg (addNoDups ways WayDebug) )
-- ToDo: user ways
------- Interface files ---------------------------------------------
......@@ -1947,6 +1947,11 @@ add var x = do
xs <- readIORef var
writeIORef var (x:xs)
addNoDups :: Eq a => IORef [a] -> a -> IO ()
addNoDups var x = do
xs <- readIORef var
if x `elem` xs then return () else writeIORef var (x:xs)
remove_suffix :: String -> Char -> String
remove_suffix s c
| null pre = reverse suf
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment