[Use optMode in Options instead of invidual modes with boolean flags
Einar Karttunen <ekarttun@cs.helsinki.fi>**20060201132644] hunk ./Main.hs 90
-    case o of
-        Opt { optShowHo     = xs@(_:_) }     -> mapM_ dumpHoFile xs
-        Opt { optBuildHl    = hlName@(_:_) } -> buildHl hlName (optArgs o)
-        Opt { optVersion    = True }         -> putStrLn versionString
-        Opt { optVersionCtx = True }         -> putStrLn changes_txt
-        Opt { optSelfTest   = True }         -> do putStrLn "Starting self testing..."
-                                                   SelfTest.selfTest (optArgs o)
-        _                                    -> processFiles  (optArgs o)
-
+    case optMode o of
+      BuildHl hl -> buildHl hl (optArgs o)
+      SelfTest   -> do putStrLn "Starting self testing..."
+                       SelfTest.selfTest (optArgs o)
+      ShowHo ho  -> dumpHoFile ho
+      Version    -> putStrLn versionString
+      VersionCtx -> putStrLn changes_txt
+      _          -> processFiles  (optArgs o)
hunk ./Main.hs 328
-    return $ optInteractive options || "ichj" `isPrefixOf` reverse pn || not (null $ optStmts options)
+    return $ (optMode options == Interactive) 
+          || "ichj" `isPrefixOf` reverse pn 
+          || not (null $ optStmts options)
hunk ./Main.hs 495
-    when (optInterpret options) $ do
+    when (optMode options == Interpret) $ do
hunk ./Main.hs 502
-    when (optCompile options) $ do
+    when (optMode options == CompileExe) $ do
hunk ./Options.hs 6
+    Mode(..),
hunk ./Options.hs 38
+data Mode = BuildHl String -- ^ Load the specified hl-files (haskell libraries).
+          | Interactive    -- ^ Run interactively.
+          | SelfTest       -- ^ Perform self-test
+          | Version        -- ^ Print version and die.
+          | VersionCtx     -- ^ Print version context and die.
+          | Interpret      -- ^ Interpret.
+          | CompileHo      -- ^ Compile ho
+          | CompileExe     -- ^ Compile executable
+          | ShowHo String  -- ^ Show ho-file.
+            deriving(Eq,Show)
+
hunk ./Options.hs 50
+    optMode        :: Mode,       -- ^ Mode of interaction
hunk ./Options.hs 52
-    optCompile     :: !Bool,      -- ^ Compile.
hunk ./Options.hs 53
-    optSelfTest    :: !Bool,      -- ^ Perform self-test
hunk ./Options.hs 58
-    optShowHo      ::  [String],  -- ^ Show ho-file.
hunk ./Options.hs 60
-    optBuildHl     ::  String,    -- ^ Build a hl (haskell library) from the set of modules given.
hunk ./Options.hs 62
-    optInteractive :: !Bool,      -- ^ Run interactively.
-    optVersion     :: !Bool,      -- ^ Print version and die.
-    optVersionCtx  :: !Bool,      -- ^ Print version context and die.
-    optInterpret   :: !Bool,      -- ^ Interpret.
hunk ./Options.hs 76
+    optMode        = CompileExe,
hunk ./Options.hs 78
-    optCompile     = True,
hunk ./Options.hs 79
-    optSelfTest    = False,
hunk ./Options.hs 81
-    optBuildHl     = "",
hunk ./Options.hs 85
-    optShowHo      = [],
hunk ./Options.hs 88
-    optInteractive = False,
hunk ./Options.hs 90
-    optInterpret   = False,
hunk ./Options.hs 95
-    optVersion     = False,
-    optVersionCtx  = False,
hunk ./Options.hs 105
-    [ Option ['V'] ["version"]   (NoArg  (optVersion_s True))    "print version info and exit"
-    , Option []    ["version-context"] (NoArg  (optVersionCtx_s True)) "print version context (darcs changes) info and exit"
+    [ Option ['V'] ["version"]   (NoArg  (optMode_s Version))    "print version info and exit"
+    , Option []    ["version-context"] (NoArg  (optMode_s VersionCtx)) "print version context (darcs changes) info and exit"
hunk ./Options.hs 116
-    , Option ['C'] ["justcheck"] (NoArg  (optCompile_s False))   "don't compile. just typecheck."
-    , Option ['I'] ["interpret"] (NoArg  (optInterpret_s True . optCompile_s False)) "interpret."
+    , Option ['C'] ["justcheck"] (NoArg  (optMode_s CompileHo))   "don't compile. just typecheck."
+    , Option ['I'] ["interpret"] (NoArg  (optMode_s Interpret)) "interpret."
hunk ./Options.hs 124
-    , Option []    ["show-ho"]   (ReqArg  (\d -> optShowHo_u (++ [d])) "file.ho") "Show ho file"
+    , Option []    ["show-ho"]   (ReqArg  (optMode_s . ShowHo) "file.ho") "Show ho file"
hunk ./Options.hs 127
-    , Option []    ["build-hl"]  (ReqArg (\d -> optBuildHl_s d) "file.hl") "Build hakell library from given list of modules"
-    , Option []    ["interactive"] (NoArg  (optInteractive_s True)) "run interactivly"
+    , Option []    ["build-hl"]  (ReqArg (optMode_s . BuildHl) "file.hl") "Build hakell library from given list of modules"
+    , Option []    ["interactive"] (NoArg  (optMode_s Interactive)) "run interactivly"
hunk ./Options.hs 131
-    , Option []    ["selftest"]   (NoArg  (optSelfTest_s True)) "Perform internal integrity testing"
+    , Option []    ["selftest"]   (NoArg  (optMode_s SelfTest)) "Perform internal integrity testing"