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 = ...@@ -1629,13 +1629,13 @@ opts =
, ( "no-recomp" , NoArg (writeIORef recomp False) ) , ( "no-recomp" , NoArg (writeIORef recomp False) )
------- ways -------------------------------------------------------- ------- ways --------------------------------------------------------
, ( "prof" , NoArg (add ways WayProf) ) , ( "prof" , NoArg (addNoDups ways WayProf) )
, ( "unreg" , NoArg (add ways WayUnreg) ) , ( "unreg" , NoArg (addNoDups ways WayUnreg) )
, ( "ticky" , NoArg (add ways WayTicky) ) , ( "ticky" , NoArg (addNoDups ways WayTicky) )
, ( "parallel" , NoArg (add ways WayPar) ) , ( "parallel" , NoArg (addNoDups ways WayPar) )
, ( "gransim" , NoArg (add ways WayGran) ) , ( "gransim" , NoArg (addNoDups ways WayGran) )
, ( "smp" , NoArg (add ways WaySMP) ) , ( "smp" , NoArg (addNoDups ways WaySMP) )
, ( "debug" , NoArg (add ways WayDebug) ) , ( "debug" , NoArg (addNoDups ways WayDebug) )
-- ToDo: user ways -- ToDo: user ways
------- Interface files --------------------------------------------- ------- Interface files ---------------------------------------------
...@@ -1947,6 +1947,11 @@ add var x = do ...@@ -1947,6 +1947,11 @@ add var x = do
xs <- readIORef var xs <- readIORef var
writeIORef var (x:xs) 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 :: String -> Char -> String
remove_suffix s c remove_suffix s c
| null pre = reverse suf | 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