[clean up code, move library building driver to FrontEnd/FrontEnd
John Meacham <john@repetae.net>**20070825033541] hunk ./FrontEnd/FrontEnd.hs 3
+    makeLibrary,
hunk ./FrontEnd/FrontEnd.hs 10
-import qualified Text.PrettyPrint.HughesPJ as PPrint
hunk ./FrontEnd/FrontEnd.hs 12
-import Doc.PPrint
hunk ./FrontEnd/FrontEnd.hs 19
-import Util.SetLike
hunk ./FrontEnd/FrontEnd.hs 20
-import qualified Doc.PPrint as PPrint
hunk ./FrontEnd/FrontEnd.hs 21
-import qualified FlagOpts as FO
hunk ./FrontEnd/FrontEnd.hs 24
+makeLibrary processInitialHo processDecls hl = createLibrary hl buildLibrary where
+    buildLibrary [] = do putErrLn "WARNING: building empty library" >> return mempty
+    buildLibrary mods = do
+        putVerboseLn $ "Building library containing: " ++ show mods
+        -- TODO - remove hidden exports
+        parseFiles (map Left mods) processInitialHo processDecls
hunk ./FrontEnd/FrontEnd.hs 40
-    (initialHo,ho) <- findModule fs ifunc (doModules func)
+    res <- findModule fs ifunc (doModules func)
hunk ./FrontEnd/FrontEnd.hs 42
-    return (initialHo,ho)
+    return res
hunk ./FrontEnd/FrontEnd.hs 48
-    --putErrLn $ show (hoExports ho)
hunk ./Ho/Build.hs 6
-    initialHo,
-    recordHoFile,
-    createLibrary,
-    checkForHoFile
+    createLibrary
hunk ./Ho/Build.hs 266
+            --modifyIORef r_dm (Map.union $ Map.fromList [ (hsModuleName hs,ModuleHo hoh newHo) | (hs,_,_) <- sc ])
hunk ./Ho/Build.hs 270
-    cho <- ifunc cho (initialHo `mappend` readHo)
+    cho <- ifunc cho (mempty { hoDataTable = dataTablePrims } `mappend` readHo)
hunk ./Ho/Build.hs 356
-    -> [String]      -- ^ files to write to
+    -> [FileName]    -- ^ files to write to
hunk ./Ho/Build.hs 358
-    -> IO ()         -- ^ Ho updated with this recordfile dependencies
+    -> IO ()
hunk ./Ho/Build.hs 455
-initialHo = mempty { hoDataTable = dataTablePrims  }
-
hunk ./Ho/Build.hs 468
-    let jfield x = maybe (error "createLibrary: description lacks required field "++show x) id $ field x
-    let mfield x = maybe [] (words . map (\c -> if c == ',' then ' ' else c)) $ field x
-    let name  = jfield "name"
-        vers  = jfield "version"
-        hmods = snub $ mfield "hidden-modules"
-        emods = snub $ mfield "exposed-modules"
-    let allmods  = sort $ map Module (emods ++ hmods)
-    (cho,ho) <- wtd (map Module emods)
+        jfield x = maybe (fail $ "createLibrary: description lacks required field " ++ show x) return $ field x
+        mfield x = maybe [] (words . map (\c -> if c == ',' then ' ' else c)) $ field x
+    name <- jfield "name"
+    vers <- jfield "version"
+    let hmods = map Module $ snub $ mfield "hidden-modules"
+        emods = map Module $ snub $ mfield "exposed-modules"
+    let allmods  = sort (emods ++ hmods)
+    (cho,ho) <- wtd emods
hunk ./Main.hs 102
-        BuildHl hl    -> createLibrary hl buildLibrary
+        BuildHl hl    -> makeLibrary processInitialHo processDecls hl
hunk ./Main.hs 115
-
-buildLibrary [] = do
-    putStrLn "WARNING: building empty library"
-    return mempty
-buildLibrary mods = do
-    putVerboseLn $ "Building library containing: " ++ show mods
-    (cho,ho) <- parseFiles (map Left mods) processInitialHo processDecls
-    -- TODO optimize, leaving out hidden module exports
-    return (cho,ho)
-
-