[project @ 1997-06-05 09:16:04 by sof]
[ghc-hetmet.git] / ghc / compiler / simplCore / FloatOut.lhs
index 361b3cf..a4d051f 100644 (file)
 module FloatOut ( floatOutwards ) where
 
 IMP_Ubiq(){-uitous-}
+IMPORT_1_3(List(partition))
 
 import CoreSyn
 
 import CmdLineOpts     ( opt_D_verbose_core2core, opt_D_simplifier_stats )
-import CostCentre      ( dupifyCC )
-import Id              ( nullIdEnv, addOneToIdEnv, growIdEnvList, IdEnv(..),
-                         GenId{-instance Outputable-}
+import CostCentre      ( dupifyCC, CostCentre )
+import Id              ( nullIdEnv, addOneToIdEnv, growIdEnvList, SYN_IE(IdEnv),
+                         GenId{-instance Outputable-}, SYN_IE(Id)
                        )
-import Outputable      ( Outputable(..){-instance (,)-} )
-import PprCore         ( GenCoreBinding{-instance-} )
-import PprStyle                ( PprStyle(..) )
+import Outputable      ( PprStyle(..), Outputable(..){-instance (,)-} )
+import PprCore
 import PprType         ( GenTyVar )
-import Pretty          ( ppInt, ppStr, ppBesides, ppAboves )
+import Pretty          ( Doc, int, ptext, hcat, vcat )
 import SetLevels       -- all of it
-import TyVar           ( GenTyVar{-instance Eq-} )
+import TyVar           ( GenTyVar{-instance Eq-}, SYN_IE(TyVar) )
 import Unique          ( Unique{-instance Eq-} )
-import Usage           ( UVar(..) )
+import UniqSupply       ( UniqSupply )
+import Usage           ( SYN_IE(UVar) )
 import Util            ( pprTrace, panic )
 \end{code}
 
@@ -95,7 +96,7 @@ floatOutwards us pgm
 
     (if opt_D_verbose_core2core
      then pprTrace "Levels added:\n"
-                  (ppAboves (map (ppr PprDebug) annotated_w_levels))
+                  (vcat (map (ppr PprDebug) annotated_w_levels))
      else id
     )
     ( if not (opt_D_simplifier_stats) then
@@ -104,10 +105,10 @@ floatOutwards us pgm
         let
            (tlets, ntlets, lams) = get_stats (sum_stats fss)
         in
-        pprTrace "FloatOut stats: " (ppBesides [
-               ppInt tlets,  ppStr " Lets floated to top level; ",
-               ppInt ntlets, ppStr " Lets floated elsewhere; from ",
-               ppInt lams,   ppStr " Lambda groups"])
+        pprTrace "FloatOut stats: " (hcat [
+               int tlets,  ptext SLIT(" Lets floated to top level; "),
+               int ntlets, ptext SLIT(" Lets floated elsewhere; from "),
+               int lams,   ptext SLIT(" Lambda groups")])
     )
     concat final_toplev_binds_s
     }}