summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-09-23 09:57:42 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-09-23 09:57:42 +0100
commit488e21c8cf07340c4d2f86f8177825a321cb312d (patch)
treebee6beca864278f07500d23c98073db1277af649
parentf3c7ed721133d53f81d945ecb737a77c2ef6ef73 (diff)
downloadhaskell-488e21c8cf07340c4d2f86f8177825a321cb312d.tar.gz
Make a new type synonym CoreProgram = [CoreBind]
and comment its invariants in Note [CoreProgram] in CoreSyn I'm not totally convinced that CoreProgram is the right name (perhaps CoreTopBinds might better), but it is useful to have a clue that you are looking at the top-level bindings. This is only a matter of a type synonym change; no deep refactoring here.
-rw-r--r--compiler/coreSyn/CoreLint.lhs2
-rw-r--r--compiler/coreSyn/CorePrep.lhs2
-rw-r--r--compiler/coreSyn/CoreSubst.lhs6
-rw-r--r--compiler/coreSyn/CoreSyn.lhs24
-rw-r--r--compiler/ghci/ByteCodeGen.lhs2
-rw-r--r--compiler/iface/TcIface.lhs2
-rw-r--r--compiler/main/GHC.hs2
-rw-r--r--compiler/main/HscMain.lhs6
-rw-r--r--compiler/main/HscTypes.lhs6
-rw-r--r--compiler/main/TidyPgm.lhs4
-rw-r--r--compiler/simplCore/CSE.lhs2
-rw-r--r--compiler/simplCore/CoreMonad.lhs10
-rw-r--r--compiler/simplCore/FloatIn.lhs2
-rw-r--r--compiler/simplCore/FloatOut.lhs2
-rw-r--r--compiler/simplCore/LiberateCase.lhs2
-rw-r--r--compiler/simplCore/OccurAnal.lhs2
-rw-r--r--compiler/simplCore/SAT.lhs2
-rw-r--r--compiler/simplCore/SetLevels.lhs2
-rw-r--r--compiler/simplCore/SimplCore.lhs24
-rw-r--r--compiler/specialise/Rules.lhs2
-rw-r--r--compiler/stgSyn/CoreToStg.lhs4
-rw-r--r--compiler/stranal/DmdAnal.lhs4
-rw-r--r--compiler/stranal/WorkWrap.lhs2
23 files changed, 69 insertions, 47 deletions
diff --git a/compiler/coreSyn/CoreLint.lhs b/compiler/coreSyn/CoreLint.lhs
index 4478a18ff1..34e294f389 100644
--- a/compiler/coreSyn/CoreLint.lhs
+++ b/compiler/coreSyn/CoreLint.lhs
@@ -99,7 +99,7 @@ find an occurence of an Id, we fetch it from the in-scope set.
\begin{code}
-lintCoreBindings :: [CoreBind] -> (Bag Message, Bag Message)
+lintCoreBindings :: CoreProgram -> (Bag Message, Bag Message)
-- Returns (warnings, errors)
lintCoreBindings binds
= initL $
diff --git a/compiler/coreSyn/CorePrep.lhs b/compiler/coreSyn/CorePrep.lhs
index 718a38c3de..9a344be6ea 100644
--- a/compiler/coreSyn/CorePrep.lhs
+++ b/compiler/coreSyn/CorePrep.lhs
@@ -144,7 +144,7 @@ type CpeRhs = CoreExpr -- Non-terminal 'rhs'
%************************************************************************
\begin{code}
-corePrepPgm :: DynFlags -> [CoreBind] -> [TyCon] -> IO [CoreBind]
+corePrepPgm :: DynFlags -> CoreProgram -> [TyCon] -> IO CoreProgram
corePrepPgm dflags binds data_tycons = do
showPass dflags "CorePrep"
us <- mkSplitUniqSupply 's'
diff --git a/compiler/coreSyn/CoreSubst.lhs b/compiler/coreSyn/CoreSubst.lhs
index 84092c2503..fd40456ac8 100644
--- a/compiler/coreSyn/CoreSubst.lhs
+++ b/compiler/coreSyn/CoreSubst.lhs
@@ -436,7 +436,7 @@ substBind subst (Rec pairs) = (subst', Rec (bndrs' `zip` rhss'))
--
-- [Aug 09] This function is not used in GHC at the moment, but seems so
-- short and simple that I'm going to leave it here
-deShadowBinds :: [CoreBind] -> [CoreBind]
+deShadowBinds :: CoreProgram -> CoreProgram
deShadowBinds binds = snd (mapAccumL substBind emptySubst binds)
\end{code}
@@ -860,8 +860,8 @@ simpleOptExprWith subst expr = simple_opt_expr subst (occurAnalyseExpr expr)
----------------------
simpleOptPgm :: DynFlags -> Module
- -> [CoreBind] -> [CoreRule] -> [CoreVect]
- -> IO ([CoreBind], [CoreRule], [CoreVect])
+ -> CoreProgram -> [CoreRule] -> [CoreVect]
+ -> IO (CoreProgram, [CoreRule], [CoreVect])
simpleOptPgm dflags this_mod binds rules vects
= do { dumpIfSet_dyn dflags Opt_D_dump_occur_anal "Occurrence analysis"
(pprCoreBindings occ_anald_binds $$ pprRules rules );
diff --git a/compiler/coreSyn/CoreSyn.lhs b/compiler/coreSyn/CoreSyn.lhs
index 32aafd4a31..2d5331aa0a 100644
--- a/compiler/coreSyn/CoreSyn.lhs
+++ b/compiler/coreSyn/CoreSyn.lhs
@@ -10,7 +10,7 @@
module CoreSyn (
-- * Main data types
Expr(..), Alt, Bind(..), AltCon(..), Arg, Note(..),
- CoreExpr, CoreAlt, CoreBind, CoreArg, CoreBndr,
+ CoreProgram, CoreExpr, CoreAlt, CoreBind, CoreArg, CoreBndr,
TaggedExpr, TaggedAlt, TaggedBind, TaggedArg, TaggedBndr(..),
-- ** 'Expr' construction
@@ -831,7 +831,29 @@ cmpAltCon con1 con2 = WARN( True, text "Comparing incomparable AltCons" <+>
%* *
%************************************************************************
+Note [CoreProgram]
+~~~~~~~~~~~~~~~~~~
+The top level bindings of a program, a CoreProgram, are represented as
+a list of CoreBind
+
+ * Later bindings in the list can refer to earlier ones, but not vice
+ versa. So this is OK
+ NonRec { x = 4 }
+ Rec { p = ...q...x...
+ ; q = ...p...x }
+ Rec { f = ...p..x..f.. }
+ NonRec { g = ..f..q...x.. }
+ But it would NOT be ok for 'f' to refer to 'g'.
+
+ * The occurrence analyser does strongly-connected component analysis
+ on each Rec binding, and splits it into a sequence of smaller
+ bindings where possible. So the program typically starts life as a
+ single giant Rec, which is then dependency-analysed into smaller
+ chunks.
+
\begin{code}
+type CoreProgram = [CoreBind] -- See Note [CoreProgram]
+
-- | The common case for the type of binders and variables when
-- we are manipulating the Core language within GHC
type CoreBndr = Var
diff --git a/compiler/ghci/ByteCodeGen.lhs b/compiler/ghci/ByteCodeGen.lhs
index 66ad5a636c..71a21c185f 100644
--- a/compiler/ghci/ByteCodeGen.lhs
+++ b/compiler/ghci/ByteCodeGen.lhs
@@ -65,7 +65,7 @@ import qualified FiniteMap as Map
-- Generating byte code for a complete module
byteCodeGen :: DynFlags
- -> [CoreBind]
+ -> CoreProgram
-> [TyCon]
-> ModBreaks
-> IO CompiledByteCode
diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs
index f0e09b49f7..328770b5f8 100644
--- a/compiler/iface/TcIface.lhs
+++ b/compiler/iface/TcIface.lhs
@@ -1028,7 +1028,7 @@ tcIfaceDataAlt con inst_tys arg_strs rhs
\begin{code}
-tcExtCoreBindings :: [IfaceBinding] -> IfL [CoreBind] -- Used for external core
+tcExtCoreBindings :: [IfaceBinding] -> IfL CoreProgram -- Used for external core
tcExtCoreBindings [] = return []
tcExtCoreBindings (b:bs) = do_one b (tcExtCoreBindings bs)
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index 928f21e8ff..5e1eaac96f 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -769,7 +769,7 @@ data CoreModule
-- | Type environment for types declared in this module
cm_types :: !TypeEnv,
-- | Declarations
- cm_binds :: [CoreBind]
+ cm_binds :: CoreProgram
}
instance Outputable CoreModule where
diff --git a/compiler/main/HscMain.lhs b/compiler/main/HscMain.lhs
index 1842799f9a..445a9cacbc 100644
--- a/compiler/main/HscMain.lhs
+++ b/compiler/main/HscMain.lhs
@@ -1211,7 +1211,7 @@ tryNewCodeGen hsc_env this_mod data_tycons
; return prog' }
-myCoreToStg :: DynFlags -> Module -> [CoreBind]
+myCoreToStg :: DynFlags -> Module -> CoreProgram
-> IO ( [(StgBinding,[(Id,[Id])])] -- output program
, CollectedCCs) -- cost centre info (declared and used)
@@ -1473,7 +1473,7 @@ hscParseThingWithLocation source linenumber parser str
hscCompileCore :: HscEnv
-> Bool
-> ModSummary
- -> [CoreBind]
+ -> CoreProgram
-> IO ()
hscCompileCore hsc_env simplify mod_summary binds
@@ -1487,7 +1487,7 @@ hscCompileCore hsc_env simplify mod_summary binds
return ()
-- Makes a "vanilla" ModGuts.
-mkModGuts :: Module -> [CoreBind] -> ModGuts
+mkModGuts :: Module -> CoreProgram -> ModGuts
mkModGuts mod binds = ModGuts {
mg_module = mod,
mg_boot = False,
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index 79c5c13c42..c14544cbd9 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -121,7 +121,7 @@ import Module
import InstEnv ( InstEnv, Instance )
import FamInstEnv
import Rules ( RuleBase )
-import CoreSyn ( CoreBind )
+import CoreSyn ( CoreProgram )
import VarEnv
import VarSet
import Var
@@ -757,7 +757,7 @@ data ModGuts
mg_fam_insts :: ![FamInst], -- ^ Family instances declared in this module
mg_rules :: ![CoreRule], -- ^ Before the core pipeline starts, contains
-- See Note [Overall plumbing for rules] in Rules.lhs
- mg_binds :: ![CoreBind], -- ^ Bindings for this module
+ mg_binds :: !CoreProgram, -- ^ Bindings for this module
mg_foreign :: !ForeignStubs, -- ^ Foreign exports declared in this module
mg_warns :: !Warnings, -- ^ Warnings declared in the module
mg_anns :: [Annotation], -- ^ Annotations declared in this module
@@ -813,7 +813,7 @@ data CgGuts
-- tables. Includes newtypes, just for the benefit of
-- External Core
- cg_binds :: [CoreBind],
+ cg_binds :: CoreProgram,
-- ^ The tidied main bindings, including
-- previously-implicit bindings for record and class
-- selectors, and data construtor wrappers. But *not*
diff --git a/compiler/main/TidyPgm.lhs b/compiler/main/TidyPgm.lhs
index 95a0871963..980b46c34b 100644
--- a/compiler/main/TidyPgm.lhs
+++ b/compiler/main/TidyPgm.lhs
@@ -997,8 +997,8 @@ rules are externalised (see init_ext_ids in function
tidyTopBinds :: HscEnv
-> UnfoldEnv
-> TidyOccEnv
- -> [CoreBind]
- -> (TidyEnv, [CoreBind])
+ -> CoreProgram
+ -> (TidyEnv, CoreProgram)
tidyTopBinds hsc_env unfold_env init_occ_env binds
= tidy init_env binds
diff --git a/compiler/simplCore/CSE.lhs b/compiler/simplCore/CSE.lhs
index b5fc41ff1d..2f5c38e387 100644
--- a/compiler/simplCore/CSE.lhs
+++ b/compiler/simplCore/CSE.lhs
@@ -185,7 +185,7 @@ happen now that we don't look inside INLINEs (which wrappers are).
%************************************************************************
\begin{code}
-cseProgram :: [CoreBind] -> [CoreBind]
+cseProgram :: CoreProgram -> CoreProgram
cseProgram binds = cseBinds emptyCSEnv binds
cseBinds :: CSEnv -> [CoreBind] -> [CoreBind]
diff --git a/compiler/simplCore/CoreMonad.lhs b/compiler/simplCore/CoreMonad.lhs
index df515d1d52..6ad402c789 100644
--- a/compiler/simplCore/CoreMonad.lhs
+++ b/compiler/simplCore/CoreMonad.lhs
@@ -128,7 +128,7 @@ stuff before and after core passes, and do Core Lint when necessary.
showPass :: DynFlags -> CoreToDo -> IO ()
showPass dflags pass = Err.showPass dflags (showSDoc (ppr pass))
-endPass :: DynFlags -> CoreToDo -> [CoreBind] -> [CoreRule] -> IO ()
+endPass :: DynFlags -> CoreToDo -> CoreProgram -> [CoreRule] -> IO ()
endPass dflags pass binds rules
= do { dumpPassResult dflags mb_flag (ppr pass) empty binds rules
; lintPassResult dflags pass binds }
@@ -147,7 +147,7 @@ dumpPassResult :: DynFlags
-- name is specified by df
-> SDoc -- Header
-> SDoc -- Extra info to appear after header
- -> [CoreBind] -> [CoreRule]
+ -> CoreProgram -> [CoreRule]
-> IO ()
dumpPassResult dflags mb_flag hdr extra_info binds rules
| Just dflag <- mb_flag
@@ -169,7 +169,7 @@ dumpPassResult dflags mb_flag hdr extra_info binds rules
, ptext (sLit "------ Local rules for imported ids --------")
, pprRules rules ]
-lintPassResult :: DynFlags -> CoreToDo -> [CoreBind] -> IO ()
+lintPassResult :: DynFlags -> CoreToDo -> CoreProgram -> IO ()
lintPassResult dflags pass binds
= when (dopt Opt_DoCoreLinting dflags) $
do { let (warns, errs) = lintCoreBindings binds
@@ -177,7 +177,7 @@ lintPassResult dflags pass binds
; displayLintResults dflags pass warns errs binds }
displayLintResults :: DynFlags -> CoreToDo
- -> Bag Err.Message -> Bag Err.Message -> [CoreBind]
+ -> Bag Err.Message -> Bag Err.Message -> CoreProgram
-> IO ()
displayLintResults dflags pass warns errs binds
| not (isEmptyBag errs)
@@ -444,7 +444,7 @@ defaultPlugin = Plugin {
-- | A description of the plugin pass itself
type PluginPass = ModGuts -> CoreM ModGuts
-bindsOnlyPass :: ([CoreBind] -> CoreM [CoreBind]) -> ModGuts -> CoreM ModGuts
+bindsOnlyPass :: (CoreProgram -> CoreM CoreProgram) -> ModGuts -> CoreM ModGuts
bindsOnlyPass pass guts
= do { binds' <- pass (mg_binds guts)
; return (guts { mg_binds = binds' }) }
diff --git a/compiler/simplCore/FloatIn.lhs b/compiler/simplCore/FloatIn.lhs
index 48daf7853b..0e49f160e6 100644
--- a/compiler/simplCore/FloatIn.lhs
+++ b/compiler/simplCore/FloatIn.lhs
@@ -32,7 +32,7 @@ Top-level interface function, @floatInwards@. Note that we do not
actually float any bindings downwards from the top-level.
\begin{code}
-floatInwards :: [CoreBind] -> [CoreBind]
+floatInwards :: CoreProgram -> CoreProgram
floatInwards = map fi_top_bind
where
fi_top_bind (NonRec binder rhs)
diff --git a/compiler/simplCore/FloatOut.lhs b/compiler/simplCore/FloatOut.lhs
index e6195e93cd..bcd118a12c 100644
--- a/compiler/simplCore/FloatOut.lhs
+++ b/compiler/simplCore/FloatOut.lhs
@@ -114,7 +114,7 @@ Well, maybe. We don't do this at the moment.
floatOutwards :: FloatOutSwitches
-> DynFlags
-> UniqSupply
- -> [CoreBind] -> IO [CoreBind]
+ -> CoreProgram -> IO CoreProgram
floatOutwards float_sws dflags us pgm
= do {
diff --git a/compiler/simplCore/LiberateCase.lhs b/compiler/simplCore/LiberateCase.lhs
index fe1f758551..8caa29a568 100644
--- a/compiler/simplCore/LiberateCase.lhs
+++ b/compiler/simplCore/LiberateCase.lhs
@@ -117,7 +117,7 @@ and the level of @h@ is zero (NB not one).
%************************************************************************
\begin{code}
-liberateCase :: DynFlags -> [CoreBind] -> [CoreBind]
+liberateCase :: DynFlags -> CoreProgram -> CoreProgram
liberateCase dflags binds = do_prog (initEnv dflags) binds
where
do_prog _ [] = []
diff --git a/compiler/simplCore/OccurAnal.lhs b/compiler/simplCore/OccurAnal.lhs
index 8a5327ef5d..b53c98f6ea 100644
--- a/compiler/simplCore/OccurAnal.lhs
+++ b/compiler/simplCore/OccurAnal.lhs
@@ -55,7 +55,7 @@ Here's the externally-callable interface:
occurAnalysePgm :: Module -- Used only in debug output
-> (Activation -> Bool)
-> [CoreRule] -> [CoreVect]
- -> [CoreBind] -> [CoreBind]
+ -> CoreProgram -> CoreProgram
occurAnalysePgm this_mod active_rule imp_rules vects binds
| isEmptyVarEnv final_usage
= binds'
diff --git a/compiler/simplCore/SAT.lhs b/compiler/simplCore/SAT.lhs
index 61182895cf..acc11ca81b 100644
--- a/compiler/simplCore/SAT.lhs
+++ b/compiler/simplCore/SAT.lhs
@@ -75,7 +75,7 @@ import FastString
\end{code}
\begin{code}
-doStaticArgs :: UniqSupply -> [CoreBind] -> [CoreBind]
+doStaticArgs :: UniqSupply -> CoreProgram -> CoreProgram
doStaticArgs us binds = snd $ mapAccumL sat_bind_threaded_us us binds
where
sat_bind_threaded_us us bind =
diff --git a/compiler/simplCore/SetLevels.lhs b/compiler/simplCore/SetLevels.lhs
index 3f665fcbdb..bbeb5d3e84 100644
--- a/compiler/simplCore/SetLevels.lhs
+++ b/compiler/simplCore/SetLevels.lhs
@@ -206,7 +206,7 @@ instance Eq Level where
\begin{code}
setLevels :: FloatOutSwitches
- -> [CoreBind]
+ -> CoreProgram
-> UniqSupply
-> [LevelledBind]
diff --git a/compiler/simplCore/SimplCore.lhs b/compiler/simplCore/SimplCore.lhs
index 3c89b0fa5d..5075075777 100644
--- a/compiler/simplCore/SimplCore.lhs
+++ b/compiler/simplCore/SimplCore.lhs
@@ -409,7 +409,7 @@ doCorePass pass = pprPanic "doCorePass" (ppr pass)
%************************************************************************
\begin{code}
-printCore :: a -> [CoreBind] -> IO ()
+printCore :: a -> CoreProgram -> IO ()
printCore _ binds = Err.dumpIfSet True "Print Core" (pprCoreBindings binds)
ruleCheckPass :: CompilerPhase -> String -> ModGuts -> CoreM ModGuts
@@ -421,36 +421,36 @@ ruleCheckPass current_phase pat guts = do
return guts
-doPassDUM :: (DynFlags -> UniqSupply -> [CoreBind] -> IO [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPassDUM :: (DynFlags -> UniqSupply -> CoreProgram -> IO CoreProgram) -> ModGuts -> CoreM ModGuts
doPassDUM do_pass = doPassM $ \binds -> do
dflags <- getDynFlags
us <- getUniqueSupplyM
liftIO $ do_pass dflags us binds
-doPassDM :: (DynFlags -> [CoreBind] -> IO [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPassDM :: (DynFlags -> CoreProgram -> IO CoreProgram) -> ModGuts -> CoreM ModGuts
doPassDM do_pass = doPassDUM (\dflags -> const (do_pass dflags))
-doPassD :: (DynFlags -> [CoreBind] -> [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPassD :: (DynFlags -> CoreProgram -> CoreProgram) -> ModGuts -> CoreM ModGuts
doPassD do_pass = doPassDM (\dflags -> return . do_pass dflags)
-doPassDU :: (DynFlags -> UniqSupply -> [CoreBind] -> [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPassDU :: (DynFlags -> UniqSupply -> CoreProgram -> CoreProgram) -> ModGuts -> CoreM ModGuts
doPassDU do_pass = doPassDUM (\dflags us -> return . do_pass dflags us)
-doPassU :: (UniqSupply -> [CoreBind] -> [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPassU :: (UniqSupply -> CoreProgram -> CoreProgram) -> ModGuts -> CoreM ModGuts
doPassU do_pass = doPassDU (const do_pass)
-- Most passes return no stats and don't change rules: these combinators
-- let us lift them to the full blown ModGuts+CoreM world
-doPassM :: Monad m => ([CoreBind] -> m [CoreBind]) -> ModGuts -> m ModGuts
+doPassM :: Monad m => (CoreProgram -> m CoreProgram) -> ModGuts -> m ModGuts
doPassM bind_f guts = do
binds' <- bind_f (mg_binds guts)
return (guts { mg_binds = binds' })
-doPass :: ([CoreBind] -> [CoreBind]) -> ModGuts -> CoreM ModGuts
+doPass :: (CoreProgram -> CoreProgram) -> ModGuts -> CoreM ModGuts
doPass bind_f guts = return $ guts { mg_binds = bind_f (mg_binds guts) }
-- Observer passes just peek; don't modify the bindings at all
-observe :: (DynFlags -> [CoreBind] -> IO a) -> ModGuts -> CoreM ModGuts
+observe :: (DynFlags -> CoreProgram -> IO a) -> ModGuts -> CoreM ModGuts
observe do_pass = doPassM $ \binds -> do
dflags <- getDynFlags
_ <- liftIO $ do_pass dflags binds
@@ -559,7 +559,7 @@ simplifyPgmIO pass@(CoreDoSimplify max_iterations mode)
do_iteration :: UniqSupply
-> Int -- Counts iterations
-> [SimplCount] -- Counts from earlier iterations, reversed
- -> [CoreBind] -- Bindings in
+ -> CoreProgram -- Bindings in
-> [CoreRule] -- and orphan rules
-> IO (String, Int, SimplCount, ModGuts)
@@ -664,7 +664,7 @@ simplifyPgmIO _ _ _ _ _ = panic "simplifyPgmIO"
-------------------
end_iteration :: DynFlags -> CoreToDo -> Int
- -> SimplCount -> [CoreBind] -> [CoreRule] -> IO ()
+ -> SimplCount -> CoreProgram -> [CoreRule] -> IO ()
end_iteration dflags pass iteration_no counts binds rules
= do { dumpPassResult dflags mb_flag hdr pp_counts binds rules
; lintPassResult dflags pass binds }
@@ -807,7 +807,7 @@ unfolding for something.
\begin{code}
type IndEnv = IdEnv Id -- Maps local_id -> exported_id
-shortOutIndirections :: [CoreBind] -> [CoreBind]
+shortOutIndirections :: CoreProgram -> CoreProgram
shortOutIndirections binds
| isEmptyVarEnv ind_env = binds
| no_need_to_flatten = binds' -- See Note [Rules and indirect-zapping]
diff --git a/compiler/specialise/Rules.lhs b/compiler/specialise/Rules.lhs
index f9d02e5ab7..a439f2ac27 100644
--- a/compiler/specialise/Rules.lhs
+++ b/compiler/specialise/Rules.lhs
@@ -1014,7 +1014,7 @@ is so important.
ruleCheckProgram :: CompilerPhase -- ^ Rule activation test
-> String -- ^ Rule pattern
-> RuleBase -- ^ Database of rules
- -> [CoreBind] -- ^ Bindings to check in
+ -> CoreProgram -- ^ Bindings to check in
-> SDoc -- ^ Resulting check message
ruleCheckProgram phase rule_pat rule_base binds
| isEmptyBag results
diff --git a/compiler/stgSyn/CoreToStg.lhs b/compiler/stgSyn/CoreToStg.lhs
index 1ebb564928..1705f0e60e 100644
--- a/compiler/stgSyn/CoreToStg.lhs
+++ b/compiler/stgSyn/CoreToStg.lhs
@@ -140,7 +140,7 @@ for x, solely to put in the SRTs lower down.
%************************************************************************
\begin{code}
-coreToStg :: PackageId -> [CoreBind] -> IO [StgBinding]
+coreToStg :: PackageId -> CoreProgram -> IO [StgBinding]
coreToStg this_pkg pgm
= return pgm'
where (_, _, pgm') = coreTopBindsToStg this_pkg emptyVarEnv pgm
@@ -153,7 +153,7 @@ coreExprToStg expr
coreTopBindsToStg
:: PackageId
-> IdEnv HowBound -- environment for the bindings
- -> [CoreBind]
+ -> CoreProgram
-> (IdEnv HowBound, FreeVarsInfo, [StgBinding])
coreTopBindsToStg _ env [] = (env, emptyFVInfo, [])
diff --git a/compiler/stranal/DmdAnal.lhs b/compiler/stranal/DmdAnal.lhs
index fab75a0601..9955490c25 100644
--- a/compiler/stranal/DmdAnal.lhs
+++ b/compiler/stranal/DmdAnal.lhs
@@ -62,14 +62,14 @@ To think about
%************************************************************************
\begin{code}
-dmdAnalPgm :: DynFlags -> [CoreBind] -> IO [CoreBind]
+dmdAnalPgm :: DynFlags -> CoreProgram -> IO CoreProgram
dmdAnalPgm _ binds
= do {
let { binds_plus_dmds = do_prog binds } ;
return binds_plus_dmds
}
where
- do_prog :: [CoreBind] -> [CoreBind]
+ do_prog :: CoreProgram -> CoreProgram
do_prog binds = snd $ mapAccumL dmdAnalTopBind emptySigEnv binds
dmdAnalTopBind :: SigEnv
diff --git a/compiler/stranal/WorkWrap.lhs b/compiler/stranal/WorkWrap.lhs
index ac10b1b773..c1e9c48390 100644
--- a/compiler/stranal/WorkWrap.lhs
+++ b/compiler/stranal/WorkWrap.lhs
@@ -54,7 +54,7 @@ info for exported values).
\end{enumerate}
\begin{code}
-wwTopBinds :: UniqSupply -> [CoreBind] -> [CoreBind]
+wwTopBinds :: UniqSupply -> CoreProgram -> CoreProgram
wwTopBinds us top_binds
= initUs_ us $ do