[clean up code, rearrange things a bit.
John Meacham <john@repetae.net>**20061125054556] {
hunk ./E/Program.hs 6
+import Maybe
hunk ./E/Program.hs 9
-import FrontEnd.Class
hunk ./E/Program.hs 10
+import Doc.DocLike
+import Doc.PPrint
+import Doc.Pretty
hunk ./E/Program.hs 14
+import E.Show
hunk ./E/Program.hs 16
+import FrontEnd.Class
hunk ./E/Program.hs 21
+import qualified FlagDump as FD
hunk ./E/Program.hs 112
+printProgram prog@Program {progCombinators = cs, progDataTable = dataTable } = do
+    sequence_ $ intersperse (putErrLn "") [ printCheckName'' dataTable v (foldr ELam e as) | (v,as,e) <- cs]
+    when (progMainEntry prog /= tvr) $
+        putErrLn $ "MainEntry: " ++ pprint (progMainEntry prog)
+    when (progEntryPoints prog /= [progMainEntry prog]) $
+        putErrLn $ "EntryPoints: " ++ hsep (map pprint (progEntryPoints prog))
+
+printCheckName'' :: DataTable -> TVr -> E -> IO ()
+printCheckName'' dataTable tvr e = do
+    let (ty,pty) = case inferType dataTable [] e of
+            Left err -> (Unknown,vcat $ map text (intersperse "---" $ tail err))
+            Right ty -> (ty,pprint ty)
+        tmatch = isJust $ match (const Nothing) [] ty (tvrType tvr)
+    when (dump FD.EInfo || verbose2) $ putErrLn (show $ tvrInfo tvr)
+    putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> (pprint $ tvrType tvr)))
+    when (not tmatch || dump FD.EVerbose) $
+        putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> pty))
+    putErrLn (render $ hang 4 (pprint tvr <+> equals <+> pprint e))
hunk ./Ho/Build.hs 233
-
-
-printCheckName'' :: DataTable -> TVr -> E -> IO ()
-printCheckName'' _dataTable tvr e = do
-    when (dump FD.EInfo || verbose2) $ putErrLn (show $ tvrInfo tvr)
-    putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> pprint (tvrType tvr)))
-    putErrLn (render $ hang 4 (pprint tvr <+> equals <+> pprint e))
+    where
+    printCheckName'' :: DataTable -> TVr -> E -> IO ()
+    printCheckName'' _dataTable tvr e = do
+        when (dump FD.EInfo || verbose2) $ putErrLn (show $ tvrInfo tvr)
+        putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> pprint (tvrType tvr)))
+        putErrLn (render $ hang 4 (pprint tvr <+> equals <+> pprint e))
hunk ./Main.hs 316
-    initialPassStats <- Stats.new
hunk ./Main.hs 333
-        let names = [ n | (n,_) <- programDs mprog']
-        when coreMini $ putErrLn ("----\n" ++ pprint names)
+        let names = pprint [ n | (n,_) <- programDs mprog']
+        when coreMini $ putErrLn ("----\n" ++ names)
hunk ./Main.hs 361
-        Stats.tickStat mstats (progStats mprog)
-        Stats.combine initialPassStats mstats
-        when miniCorePass $ mapM_ (\ (v,lc) -> printCheckName'' fullDataTable v lc) (programDs mprog)
-        when miniCoreSteps $ Stats.print ("InitialOptimize:" ++ pprint names) mstats
+        when miniCorePass $ printProgram mprog -- mapM_ (\ (v,lc) -> printCheckName'' fullDataTable v lc) (programDs mprog)
+        when miniCoreSteps $ Stats.printLStat (optStatLevel options) ("InitialOptimize:" ++ names) (progStats mprog)
hunk ./Main.hs 368
-    printESize "Before programMapRecGroups" prog
hunk ./Main.hs 369
-    printESize "After  programMapRecGroups" prog
hunk ./Main.hs 373
-        Stats.print "Initial Pass Stats" initialPassStats
+        Stats.printLStat (optStatLevel options) "Initial Pass Stats" (progStats prog)
hunk ./Main.hs 1119
-printProgram prog@Program {progCombinators = cs, progDataTable = dataTable } = do
-    sequence_ $ intersperse (putErrLn "") [ printCheckName'' dataTable v (foldr ELam e as) | (v,as,e) <- cs]
-    when (progMainEntry prog /= tvr) $
-        putErrLn $ "MainEntry: " ++ pprint (progMainEntry prog)
-    when (progEntryPoints prog /= [progMainEntry prog]) $
-        putErrLn $ "EntryPoints: " ++ hsep (map pprint (progEntryPoints prog))
hunk ./Main.hs 1121
-printCheckName'' :: DataTable -> TVr -> E -> IO ()
-printCheckName'' dataTable tvr e = do
-    let (ty,pty) = case inferType dataTable [] e of
-            Left err -> (Unknown,vcat $ map text (intersperse "---" $ tail err))
-            Right ty -> (ty,pprint ty)
-        tmatch = isJust $ match (const Nothing) [] ty (tvrType tvr)
-    when (dump FD.EInfo || verbose2) $ putErrLn (show $ tvrInfo tvr)
-    putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> (pprint $ tvrType tvr)))
-    when (not tmatch || dump FD.EVerbose) $
-        putErrLn (render $ hang 4 (pprint tvr <+> text "::" <+> pty))
-    putErrLn (render $ hang 4 (pprint tvr <+> equals <+> pprint e))
}
