[Add basic Haskell Library (hl file) support
John Meacham <john@repetae.net>**20050426024933] hunk ./FrontEnd/FrontEnd.hs 38
+    initialHo <- loadLibraries
hunk ./Ho.hs 1
-module Ho(Ho(..),HoHeader(..),FileDep(..),findModule,showHoCounts,initialHo,dumpHoFile) where
+module Ho(Ho(..),HoHeader(..),FileDep(..),findModule,showHoCounts,initialHo,dumpHoFile,loadLibraries,recordHoFile) where
hunk ./Ho.hs 162
-    if optIgnoreHo options then do
-        wdump FD.Progress $ do
-            fn' <- shortenPath fn
-            putErrLn $ "Skipping haskell object file:" <+> fn'
-        return Nothing 
-     else do 
+--    if optIgnoreHo options then do
+--        wdump FD.Progress $ do
+--            fn' <- shortenPath fn
+--            putErrLn $ "Skipping haskell object file:" <+> fn'
+--        return Nothing 
+--     else do 
hunk ./Ho.hs 325
-            mho <- checkForHoFile ho_name 
+            mho <- if optIgnoreHo options then do
+                    wdump FD.Progress $ do
+                        putErrLn $ "Skipping haskell object file:" <+> ho_name
+                    return Nothing 
+                   else checkForHoFile ho_name 
hunk ./Ho.hs 459
+
+loadLibraries :: IO Ho 
+loadLibraries = f initialHo (optHls options)  where
+    f ho [] = return ho
+    f ho (fn:rs) = checkForHoFile fn >>= \x -> case x of
+        Nothing -> putErrDie $ "Library not found or invalid: " ++ show fn
+        Just (_,ho') -> f (ho' `mappend` ho) rs
+        
+    
hunk ./Main.hs 76
-    case optShowHo options of
-        [] -> processFiles  (optArgs o)
-        xs -> mapM_ dumpHoFile xs
+    case o of
+        Opt { optShowHo = xs@(_:_) } -> mapM_ dumpHoFile xs
+        Opt { optBuildHl = hlName@(_:_) } -> buildHl hlName (optArgs o) 
+        _ -> processFiles  (optArgs o)
+
+buildHl fname [] = putErrDie "Cannot build hl file without list of input modules"
+buildHl fname ms = do
+    stats <- Stats.new
+    me <- parseFiles [] (map Module ms) (processDecls stats)
+    recordHoFile me [fname] HoHeader { hohGeneration = 0, hohDepends = [], hohModDepends = [] }
+    return ()
hunk ./Options.hs 27
+    optHls         ::  [String],
+    optBuildHl     ::  String,
hunk ./Options.hs 51
+    optHls         = [],
+    optBuildHl     = "",
hunk ./Options.hs 97
+    , Option ['p'] []            (ReqArg (\d -> optHls_u (++ [d])) "file.hl") "Load given haskell library .hl file"
+    , Option []    ["build-hl"]  (ReqArg (\d -> optBuildHl_s d) "file.hl") "Build hakell library from given list of modules"
hunk ./lib/Foreign/C/Error.hs 1
-{-# OPTIONS -fno-implicit-prelude -#include "HsBase.h" #-}