[Move version and selftest stuff from Options to Main making recompiles faster
Einar Karttunen <ekarttun@cs.helsinki.fi>**20051223173248
 
 Options.hs was including Version.hs which changed upon each "darcs record".
 This was causing needless recompilations. Moved handling --version and
 --selftest to the proper place in Main. Additionally changed the hierarchy
 of autogenerated Version modules. Now it is enough to "import Version" and
 get all the needed code.
 
 Additionally progress reporting was cleaned a little bit inside Main.
] adddir ./Version
hunk ./Interactive.hs 48
+import Version(versionString)
hunk ./Main.hs 53
+import SelfTest(selfTest)
hunk ./Main.hs 65
+import Version
hunk ./Main.hs 71
-
+progress str = wdump FD.Progress (putErrLn str)
+progressM c  = wdump FD.Progress (c >>= putErrLn)
hunk ./Main.hs 83
-    wdump FD.Progress $ do
+    progressM $ do
hunk ./Main.hs 86
-        putStrLn (simpleQuote (name:args))
+        return (simpleQuote (name:args))
hunk ./Main.hs 88
-        Opt { optShowHo = xs@(_:_) } -> mapM_ dumpHoFile xs
-        Opt { optBuildHl = hlName@(_:_) } -> buildHl hlName (optArgs o)
-        _ -> processFiles  (optArgs o)
+        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)
+
+
hunk ./Main.hs 281
-    wdump FD.Progress $ putErrLn "!"
+    progress "!"
hunk ./Main.hs 427
-    wdump FD.Progress $ putErrLn "Converting to Grin..."
+    progress "Converting to Grin..."
hunk ./Main.hs 449
-    wdump FD.Progress $ putErrLn "Points-to analysis..."
+    progress "Points-to analysis..."
hunk ./Main.hs 464
-        wdump FD.Progress $ putErrLn "Interpreting..."
+        progress "Interpreting..."
hunk ./Main.hs 474
-        wdump FD.Progress $ putErrLn ("Writing " ++ show cf)
+        progress ("Writing " ++ show cf)
hunk ./Main.hs 484
-        wdump FD.Progress $ putErrLn ("Running: " ++ comm)
+        progress ("Running: " ++ comm)
hunk ./Makefile 15
-BUILTSOURCES= PrimitiveOperators.hs RawFiles.hs FrontEnd/HsParser.hs FlagDump.hs FlagOpts.hs Version.hs VersionCtx.hs
+BUILTSOURCES= PrimitiveOperators.hs RawFiles.hs FrontEnd/HsParser.hs FlagDump.hs FlagOpts.hs Version/Raw.hs Version/Ctx.hs
hunk ./Makefile 88
-VersionCtx.hs: _darcs/inventory
+Version/Ctx.hs: _darcs/inventory
hunk ./Makefile 90
-	perl ./utils/op_raw.prl $(basename $@) changes.txt > $@
+	perl ./utils/op_raw.prl Version.Ctx changes.txt > $@
hunk ./Makefile 93
-Version.hs: _darcs/inventory
-	echo "module Version where"                                     > $@
+Version/Raw.hs: _darcs/inventory
+	echo "module Version.Raw where"                                > $@
hunk ./Makefile 101
-	echo 'basePackages = ["base-0.1", "haskell98-0.1"]'            >> $@
hunk ./Options.hs 15
-    versionString,
hunk ./Options.hs 23
+import Control.Monad.Error()    -- IO MonadPlus instance
hunk ./Options.hs 26
-import Control.Monad.Trans
-import Data.Version
-import Monad
hunk ./Options.hs 29
-import System.Info
hunk ./Options.hs 34
-import {-# SOURCE #-} SelfTest(selfTest)
-import Version
-import VersionCtx
+
+basePackages = ["base-0.1", "haskell98-0.1"]
hunk ./Options.hs 156
-versionString = concat ["jhc ", jhcVersion, " ", compileDate, " (", darcsTag, "+",darcsPatches, ")\n"]
-                 ++ "compiled by " ++ compilerName ++ "-" ++ showVersion compilerVersion ++ " on a " ++ arch ++ " running " ++ os
-
hunk ./Options.hs 165
-                    (Opt { optVersion = True },_) -> do
-                        putStrLn versionString
-                        exitSuccess
-                    (Opt { optVersionCtx = True },_) -> do
-                        putStrLn changes_txt
-                        exitSuccess
-                    (Opt { optSelfTest = True},_) -> do
-                        putStrLn "Starting self testing..."
-                        SelfTest.selfTest ns
-                        exitSuccess
hunk ./SelfTest.hs-boot 1
-module SelfTest where
-
-import Boolean.TestCases()
-
-selfTest :: [String] -> IO ()
rmfile ./SelfTest.hs-boot
addfile ./Version.hs
hunk ./Version.hs 1
+module Version
+    (module Version.Ctx,
+     module Version.Raw,
+     versionString) where
+
+import Data.Version
+import System.Info
+
+import Version.Ctx
+import Version.Raw
+
+versionString = concat ["jhc ", jhcVersion, " ", compileDate, " (", darcsTag, "+",darcsPatches, ")\n",
+                        "compiled by ",compilerName,"-",showVersion compilerVersion," on a ",arch," running ",os]