summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Op
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/Op')
-rw-r--r--compiler/GHC/Core/Op/CSE.hs8
-rw-r--r--compiler/GHC/Core/Op/CallArity.hs10
-rw-r--r--compiler/GHC/Core/Op/ConstantFold.hs14
-rw-r--r--compiler/GHC/Core/Op/CprAnal.hs12
-rw-r--r--compiler/GHC/Core/Op/DmdAnal.hs22
-rw-r--r--compiler/GHC/Core/Op/Exitify.hs12
-rw-r--r--compiler/GHC/Core/Op/FloatIn.hs10
-rw-r--r--compiler/GHC/Core/Op/FloatOut.hs8
-rw-r--r--compiler/GHC/Core/Op/LiberateCase.hs4
-rw-r--r--compiler/GHC/Core/Op/Monad.hs14
-rw-r--r--compiler/GHC/Core/Op/OccurAnal.hs26
-rw-r--r--compiler/GHC/Core/Op/SetLevels.hs36
-rw-r--r--compiler/GHC/Core/Op/Simplify.hs32
-rw-r--r--compiler/GHC/Core/Op/Simplify/Driver.hs18
-rw-r--r--compiler/GHC/Core/Op/Simplify/Env.hs12
-rw-r--r--compiler/GHC/Core/Op/Simplify/Monad.hs12
-rw-r--r--compiler/GHC/Core/Op/Simplify/Utils.hs18
-rw-r--r--compiler/GHC/Core/Op/SpecConstr.hs24
-rw-r--r--compiler/GHC/Core/Op/Specialise.hs22
-rw-r--r--compiler/GHC/Core/Op/StaticArgs.hs18
-rw-r--r--compiler/GHC/Core/Op/Tidy.hs18
-rw-r--r--compiler/GHC/Core/Op/WorkWrap.hs14
-rw-r--r--compiler/GHC/Core/Op/WorkWrap/Lib.hs28
23 files changed, 196 insertions, 196 deletions
diff --git a/compiler/GHC/Core/Op/CSE.hs b/compiler/GHC/Core/Op/CSE.hs
index dc93dacf07..790e9b97d3 100644
--- a/compiler/GHC/Core/Op/CSE.hs
+++ b/compiler/GHC/Core/Op/CSE.hs
@@ -16,9 +16,9 @@ module GHC.Core.Op.CSE (cseProgram, cseOneExpr) where
import GhcPrelude
import GHC.Core.Subst
-import Var ( Var )
-import VarEnv ( mkInScopeSet )
-import Id ( Id, idType, idHasRules
+import GHC.Types.Var ( Var )
+import GHC.Types.Var.Env ( mkInScopeSet )
+import GHC.Types.Id ( Id, idType, idHasRules
, idInlineActivation, setInlineActivation
, zapIdOccInfo, zapIdUsageInfo, idInlinePragma
, isJoinId, isJoinId_maybe )
@@ -29,7 +29,7 @@ import GHC.Core.FVs ( exprFreeVars )
import GHC.Core.Type ( tyConAppArgs )
import GHC.Core
import Outputable
-import BasicTypes
+import GHC.Types.Basic
import GHC.Core.Map
import Util ( filterOut, equalLength, debugIsOn )
import Data.List ( mapAccumL )
diff --git a/compiler/GHC/Core/Op/CallArity.hs b/compiler/GHC/Core/Op/CallArity.hs
index aaf3372071..2ad5f169d8 100644
--- a/compiler/GHC/Core/Op/CallArity.hs
+++ b/compiler/GHC/Core/Op/CallArity.hs
@@ -9,17 +9,17 @@ module GHC.Core.Op.CallArity
import GhcPrelude
-import VarSet
-import VarEnv
+import GHC.Types.Var.Set
+import GHC.Types.Var.Env
import GHC.Driver.Session ( DynFlags )
-import BasicTypes
+import GHC.Types.Basic
import GHC.Core
-import Id
+import GHC.Types.Id
import GHC.Core.Arity ( typeArity )
import GHC.Core.Utils ( exprIsCheap, exprIsTrivial )
import UnVarGraph
-import Demand
+import GHC.Types.Demand
import Util
import Control.Arrow ( first, second )
diff --git a/compiler/GHC/Core/Op/ConstantFold.hs b/compiler/GHC/Core/Op/ConstantFold.hs
index 126666a509..9b897f8efd 100644
--- a/compiler/GHC/Core/Op/ConstantFold.hs
+++ b/compiler/GHC/Core/Op/ConstantFold.hs
@@ -28,12 +28,12 @@ where
import GhcPrelude
-import {-# SOURCE #-} MkId ( mkPrimOpId, magicDictId )
+import {-# SOURCE #-} GHC.Types.Id.Make ( mkPrimOpId, magicDictId )
import GHC.Core
import GHC.Core.Make
-import Id
-import Literal
+import GHC.Types.Id
+import GHC.Types.Literal
import GHC.Core.SimpleOpt ( exprIsLiteral_maybe )
import PrimOp ( PrimOp(..), tagToEnumKey )
import TysWiredIn
@@ -47,13 +47,13 @@ import GHC.Core.Utils ( cheapEqExpr, cheapEqExpr', exprIsHNF, exprType
, stripTicksTop, stripTicksTopT, mkTicks )
import GHC.Core.Unfold ( exprIsConApp_maybe )
import GHC.Core.Type
-import OccName ( occNameFS )
+import GHC.Types.Name.Occurrence ( occNameFS )
import PrelNames
import Maybes ( orElse )
-import Name ( Name, nameOccName )
+import GHC.Types.Name ( Name, nameOccName )
import Outputable
import FastString
-import BasicTypes
+import GHC.Types.Basic
import GHC.Platform
import Util
import GHC.Core.Coercion (mkUnbranchedAxInstCo,mkSymCo,Role(..))
@@ -2123,7 +2123,7 @@ tx_lit_con platform adjust (LitAlt l) = Just $ LitAlt (mapLitValue platform adju
tx_lit_con _ _ alt = pprPanic "caseRules" (ppr alt)
-- NB: mapLitValue uses mkLitIntWrap etc, to ensure that the
-- literal alternatives remain in Word/Int target ranges
- -- (See Note [Word/Int underflow/overflow] in Literal and #13172).
+ -- (See Note [Word/Int underflow/overflow] in GHC.Types.Literal and #13172).
adjustDyadicRight :: PrimOp -> Integer -> Maybe (Integer -> Integer)
-- Given (x `op` lit) return a function 'f' s.t. f (x `op` lit) = x
diff --git a/compiler/GHC/Core/Op/CprAnal.hs b/compiler/GHC/Core/Op/CprAnal.hs
index c8f7e314e9..8016c2c13d 100644
--- a/compiler/GHC/Core/Op/CprAnal.hs
+++ b/compiler/GHC/Core/Op/CprAnal.hs
@@ -15,17 +15,17 @@ import GhcPrelude
import GHC.Core.Op.WorkWrap.Lib ( deepSplitProductType_maybe )
import GHC.Driver.Session
-import Demand
-import Cpr
+import GHC.Types.Demand
+import GHC.Types.Cpr
import GHC.Core
import GHC.Core.Seq
import Outputable
-import VarEnv
-import BasicTypes
+import GHC.Types.Var.Env
+import GHC.Types.Basic
import Data.List
import GHC.Core.DataCon
-import Id
-import IdInfo
+import GHC.Types.Id
+import GHC.Types.Id.Info
import GHC.Core.Utils ( exprIsHNF, dumpIdInfoOfProgram )
import GHC.Core.TyCon
import GHC.Core.Type
diff --git a/compiler/GHC/Core/Op/DmdAnal.hs b/compiler/GHC/Core/Op/DmdAnal.hs
index eb9f277f8a..88e96773ac 100644
--- a/compiler/GHC/Core/Op/DmdAnal.hs
+++ b/compiler/GHC/Core/Op/DmdAnal.hs
@@ -17,16 +17,16 @@ import GhcPrelude
import GHC.Driver.Session
import GHC.Core.Op.WorkWrap.Lib ( findTypeShape )
-import Demand -- All of it
+import GHC.Types.Demand -- All of it
import GHC.Core
import GHC.Core.Seq ( seqBinds )
import Outputable
-import VarEnv
-import BasicTypes
+import GHC.Types.Var.Env
+import GHC.Types.Basic
import Data.List ( mapAccumL )
import GHC.Core.DataCon
-import Id
-import IdInfo
+import GHC.Types.Id
+import GHC.Types.Id.Info
import GHC.Core.Utils
import GHC.Core.TyCon
import GHC.Core.Type
@@ -37,7 +37,7 @@ import Maybes ( isJust )
import TysWiredIn
import TysPrim ( realWorldStatePrimTy )
import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) )
-import UniqSet
+import GHC.Types.Unique.Set
{-
************************************************************************
@@ -136,7 +136,7 @@ dmdAnalStar env dmd e
, (dmd_ty, e') <- dmdAnal env cd e
= ASSERT2( not (isUnliftedType (exprType e)) || exprOkForSpeculation e, ppr e )
-- The argument 'e' should satisfy the let/app invariant
- -- See Note [Analysing with absent demand] in Demand.hs
+ -- See Note [Analysing with absent demand] in GHC.Types.Demand
(postProcessDmdType dmd_shell dmd_ty, e')
-- Main Demand Analsysis machinery
@@ -389,7 +389,7 @@ Note [Demand on the scrutinee of a product case]
When figuring out the demand on the scrutinee of a product case,
we use the demands of the case alternative, i.e. id_dmds.
But note that these include the demand on the case binder;
-see Note [Demand on case-alternative binders] in Demand.hs.
+see Note [Demand on case-alternative binders] in GHC.Types.Demand.
This is crucial. Example:
f x = case x of y { (a,b) -> k y a }
If we just take scrut_demand = U(L,A), then we won't pass x to the
@@ -730,7 +730,7 @@ trivial RHS (see Note [Demand analysis for trivial right-hand sides]).
Because idArity of a function varies independently of its cardinality properties
(cf. Note [idArity varies independently of dmdTypeDepth]), we implicitly encode
the arity for when a demand signature is sound to unleash in its 'dmdTypeDepth'
-(cf. Note [Understanding DmdType and StrictSig] in Demand). It is unsound to
+(cf. Note [Understanding DmdType and StrictSig] in GHC.Types.Demand). It is unsound to
unleash a demand signature when the incoming number of arguments is less than
that. See Note [What are demand signatures?] for more details on soundness.
@@ -777,7 +777,7 @@ reset or decrease arity. That's an unnecessary dependency, because
* idArity is analysis information itself, thus volatile
* We already *have* dmdTypeDepth, wo why not just use it to encode the
threshold for when to unleash the signature
- (cf. Note [Understanding DmdType and StrictSig] in Demand)
+ (cf. Note [Understanding DmdType and StrictSig] in GHC.Types.Demand)
Consider the following expression, for example:
@@ -1167,7 +1167,7 @@ findBndrsDmds env dmd_ty bndrs
| otherwise = go dmd_ty bs
findBndrDmd :: AnalEnv -> Bool -> DmdType -> Id -> (DmdType, Demand)
--- See Note [Trimming a demand to a type] in Demand.hs
+-- See Note [Trimming a demand to a type] in GHC.Types.Demand
findBndrDmd env arg_of_dfun dmd_ty id
= (dmd_ty', dmd')
where
diff --git a/compiler/GHC/Core/Op/Exitify.hs b/compiler/GHC/Core/Op/Exitify.hs
index 45f9451787..bc6bca21e9 100644
--- a/compiler/GHC/Core/Op/Exitify.hs
+++ b/compiler/GHC/Core/Op/Exitify.hs
@@ -36,15 +36,15 @@ Now `t` is no longer in a recursive function, and good things happen!
-}
import GhcPrelude
-import Var
-import Id
-import IdInfo
+import GHC.Types.Var
+import GHC.Types.Id
+import GHC.Types.Id.Info
import GHC.Core
import GHC.Core.Utils
import State
-import Unique
-import VarSet
-import VarEnv
+import GHC.Types.Unique
+import GHC.Types.Var.Set
+import GHC.Types.Var.Env
import GHC.Core.FVs
import FastString
import GHC.Core.Type
diff --git a/compiler/GHC/Core/Op/FloatIn.hs b/compiler/GHC/Core/Op/FloatIn.hs
index 454ce39dfb..381dd0ddba 100644
--- a/compiler/GHC/Core/Op/FloatIn.hs
+++ b/compiler/GHC/Core/Op/FloatIn.hs
@@ -28,16 +28,16 @@ import GHC.Core.Make hiding ( wrapFloats )
import GHC.Driver.Types ( ModGuts(..) )
import GHC.Core.Utils
import GHC.Core.FVs
-import GHC.Core.Op.Monad ( CoreM )
-import Id ( isOneShotBndr, idType, isJoinId, isJoinId_maybe )
-import Var
+import GHC.Core.Op.Monad ( CoreM )
+import GHC.Types.Id ( isOneShotBndr, idType, isJoinId, isJoinId_maybe )
+import GHC.Types.Var
import GHC.Core.Type
-import VarSet
+import GHC.Types.Var.Set
import Util
import GHC.Driver.Session
import Outputable
-- import Data.List ( mapAccumL )
-import BasicTypes ( RecFlag(..), isRec )
+import GHC.Types.Basic ( RecFlag(..), isRec )
{-
Top-level interface function, @floatInwards@. Note that we do not
diff --git a/compiler/GHC/Core/Op/FloatOut.hs b/compiler/GHC/Core/Op/FloatOut.hs
index fb47b2b3ed..f4a9649f98 100644
--- a/compiler/GHC/Core/Op/FloatOut.hs
+++ b/compiler/GHC/Core/Op/FloatOut.hs
@@ -19,11 +19,11 @@ import GHC.Core.Arity ( etaExpand )
import GHC.Core.Op.Monad ( FloatOutSwitches(..) )
import GHC.Driver.Session
-import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) )
-import Id ( Id, idArity, idType, isBottomingId,
- isJoinId, isJoinId_maybe )
+import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) )
+import GHC.Types.Id ( Id, idArity, idType, isBottomingId,
+ isJoinId, isJoinId_maybe )
import GHC.Core.Op.SetLevels
-import UniqSupply ( UniqSupply )
+import GHC.Types.Unique.Supply ( UniqSupply )
import Bag
import Util
import Maybes
diff --git a/compiler/GHC/Core/Op/LiberateCase.hs b/compiler/GHC/Core/Op/LiberateCase.hs
index 399abf4c67..e753815736 100644
--- a/compiler/GHC/Core/Op/LiberateCase.hs
+++ b/compiler/GHC/Core/Op/LiberateCase.hs
@@ -15,8 +15,8 @@ import GHC.Driver.Session
import GHC.Core
import GHC.Core.Unfold ( couldBeSmallEnoughToInline )
import TysWiredIn ( unitDataConId )
-import Id
-import VarEnv
+import GHC.Types.Id
+import GHC.Types.Var.Env
import Util ( notNull )
{-
diff --git a/compiler/GHC/Core/Op/Monad.hs b/compiler/GHC/Core/Op/Monad.hs
index a0a15bba6f..a2c12d638f 100644
--- a/compiler/GHC/Core/Op/Monad.hs
+++ b/compiler/GHC/Core/Op/Monad.hs
@@ -52,21 +52,21 @@ import GhcPrelude hiding ( read )
import GHC.Core
import GHC.Driver.Types
-import Module
+import GHC.Types.Module
import GHC.Driver.Session
-import BasicTypes ( CompilerPhase(..) )
-import Annotations
+import GHC.Types.Basic ( CompilerPhase(..) )
+import GHC.Types.Annotations
import IOEnv hiding ( liftIO, failM, failWithM )
import qualified IOEnv ( liftIO )
-import Var
+import GHC.Types.Var
import Outputable
import FastString
import ErrUtils( Severity(..), DumpFormat (..), dumpOptionsFromFlag )
-import UniqSupply
+import GHC.Types.Unique.Supply
import MonadUtils
-import NameEnv
-import SrcLoc
+import GHC.Types.Name.Env
+import GHC.Types.SrcLoc
import Data.Bifunctor ( bimap )
import ErrUtils (dumpAction)
import Data.List (intersperse, groupBy, sortBy)
diff --git a/compiler/GHC/Core/Op/OccurAnal.hs b/compiler/GHC/Core/Op/OccurAnal.hs
index b676be38ae..ac1c665e1e 100644
--- a/compiler/GHC/Core/Op/OccurAnal.hs
+++ b/compiler/GHC/Core/Op/OccurAnal.hs
@@ -28,24 +28,24 @@ import GHC.Core.FVs
import GHC.Core.Utils ( exprIsTrivial, isDefaultAlt, isExpandableApp,
stripTicksTopE, mkTicks )
import GHC.Core.Arity ( joinRhsArity )
-import Id
-import IdInfo
-import Name( localiseName )
-import BasicTypes
-import Module( Module )
+import GHC.Types.Id
+import GHC.Types.Id.Info
+import GHC.Types.Name( localiseName )
+import GHC.Types.Basic
+import GHC.Types.Module( Module )
import GHC.Core.Coercion
import GHC.Core.Type
-import VarSet
-import VarEnv
-import Var
-import Demand ( argOneShots, argsOneShots )
+import GHC.Types.Var.Set
+import GHC.Types.Var.Env
+import GHC.Types.Var
+import GHC.Types.Demand ( argOneShots, argsOneShots )
import Digraph ( SCC(..), Node(..)
, stronglyConnCompFromEdgedVerticesUniq
, stronglyConnCompFromEdgedVerticesUniqR )
-import Unique
-import UniqFM
-import UniqSet
+import GHC.Types.Unique
+import GHC.Types.Unique.FM
+import GHC.Types.Unique.Set
import Util
import Outputable
import Data.List
@@ -1870,7 +1870,7 @@ occAnalApp env (Var fun, args, ticks)
n_args = length args
fun_uds = mkOneOcc env fun (if n_val_args > 0 then IsInteresting else NotInteresting) n_args
is_exp = isExpandableApp fun n_val_args
- -- See Note [CONLIKE pragma] in BasicTypes
+ -- See Note [CONLIKE pragma] in GHC.Types.Basic
-- The definition of is_exp should match that in GHC.Core.Op.Simplify.prepareRhs
one_shots = argsOneShots (idStrictness fun) guaranteed_val_args
diff --git a/compiler/GHC/Core/Op/SetLevels.hs b/compiler/GHC/Core/Op/SetLevels.hs
index a3b1fd75b3..0ac49a0c1c 100644
--- a/compiler/GHC/Core/Op/SetLevels.hs
+++ b/compiler/GHC/Core/Op/SetLevels.hs
@@ -79,28 +79,28 @@ import GHC.Core.FVs -- all of it
import GHC.Core.Subst
import GHC.Core.Make ( sortQuantVars )
-import Id
-import IdInfo
-import Var
-import VarSet
-import UniqSet ( nonDetFoldUniqSet )
-import UniqDSet ( getUniqDSet )
-import VarEnv
-import Literal ( litIsTrivial )
-import Demand ( StrictSig, Demand, isStrictDmd, splitStrictSig, increaseStrictSigArity )
-import Cpr ( mkCprSig, botCpr )
-import Name ( getOccName, mkSystemVarName )
-import OccName ( occNameString )
+import GHC.Types.Id
+import GHC.Types.Id.Info
+import GHC.Types.Var
+import GHC.Types.Var.Set
+import GHC.Types.Unique.Set ( nonDetFoldUniqSet )
+import GHC.Types.Unique.DSet ( getUniqDSet )
+import GHC.Types.Var.Env
+import GHC.Types.Literal ( litIsTrivial )
+import GHC.Types.Demand ( StrictSig, Demand, isStrictDmd, splitStrictSig, increaseStrictSigArity )
+import GHC.Types.Cpr ( mkCprSig, botCpr )
+import GHC.Types.Name ( getOccName, mkSystemVarName )
+import GHC.Types.Name.Occurrence ( occNameString )
import GHC.Core.Type ( Type, mkLamTypes, splitTyConApp_maybe, tyCoVarsOfType
, mightBeUnliftedType, closeOverKindsDSet )
-import BasicTypes ( Arity, RecFlag(..), isRec )
+import GHC.Types.Basic ( Arity, RecFlag(..), isRec )
import GHC.Core.DataCon ( dataConOrigResTy )
import TysWiredIn
-import UniqSupply
+import GHC.Types.Unique.Supply
import Util
import Outputable
import FastString
-import UniqDFM
+import GHC.Types.Unique.DFM
import FV
import Data.Maybe
import MonadUtils ( mapAccumLM )
@@ -1352,7 +1352,7 @@ lvlLamBndrs env lvl bndrs
is_major bndr = isId bndr && not (isProbablyOneShotLambda bndr)
-- The "probably" part says "don't float things out of a
-- probable one-shot lambda"
- -- See Note [Computing one-shot info] in Demand.hs
+ -- See Note [Computing one-shot info] in GHC.Types.Demand
lvlJoinBndrs :: LevelEnv -> Level -> RecFlag -> [OutVar]
-> (LevelEnv, [LevelledBndr])
@@ -1619,7 +1619,7 @@ abstractVars :: Level -> LevelEnv -> DVarSet -> [OutVar]
-- abstracted in deterministic order, not dependent on the values of
-- Uniques. This is achieved by using DVarSets, deterministic free
-- variable computation and deterministic sort.
- -- See Note [Unique Determinism] in Unique for explanation of why
+ -- See Note [Unique Determinism] in GHC.Types.Unique for explanation of why
-- Uniques are not deterministic.
abstractVars dest_lvl (LE { le_subst = subst, le_lvl_env = lvl_env }) in_fvs
= -- NB: sortQuantVars might not put duplicates next to each other
@@ -1667,7 +1667,7 @@ newPolyBndrs dest_lvl
add_subst env (v, v') = extendIdSubst env v (mkVarApps (Var v') abs_vars)
add_id env (v, v') = extendVarEnv env v ((v':abs_vars), mkVarApps (Var v') abs_vars)
- mk_poly_bndr bndr uniq = transferPolyIdInfo bndr abs_vars $ -- Note [transferPolyIdInfo] in Id.hs
+ mk_poly_bndr bndr uniq = transferPolyIdInfo bndr abs_vars $ -- Note [transferPolyIdInfo] in GHC.Types.Id
transfer_join_info bndr $
mkSysLocal (mkFastString str) uniq poly_ty
where
diff --git a/compiler/GHC/Core/Op/Simplify.hs b/compiler/GHC/Core/Op/Simplify.hs
index 760beeddb2..5d7d91a37f 100644
--- a/compiler/GHC/Core/Op/Simplify.hs
+++ b/compiler/GHC/Core/Op/Simplify.hs
@@ -21,13 +21,13 @@ import GHC.Core.Op.Simplify.Env
import GHC.Core.Op.Simplify.Utils
import GHC.Core.Op.OccurAnal ( occurAnalyseExpr )
import GHC.Core.FamInstEnv ( FamInstEnv )
-import Literal ( litIsLifted ) --, mkLitInt ) -- temporalily commented out. See #8326
-import Id
-import MkId ( seqId )
-import GHC.Core.Make ( FloatBind, mkImpossibleExpr, castBottomExpr )
+import GHC.Types.Literal ( litIsLifted ) --, mkLitInt ) -- temporalily commented out. See #8326
+import GHC.Types.Id
+import GHC.Types.Id.Make ( seqId )
+import GHC.Core.Make ( FloatBind, mkImpossibleExpr, castBottomExpr )
import qualified GHC.Core.Make
-import IdInfo
-import Name ( mkSystemVarName, isExternalName, getOccFS )
+import GHC.Types.Id.Info
+import GHC.Types.Name ( mkSystemVarName, isExternalName, getOccFS )
import GHC.Core.Coercion hiding ( substCo, substCoVar )
import GHC.Core.Coercion.Opt ( optCoercion )
import GHC.Core.FamInstEnv ( topNormaliseType_maybe )
@@ -37,27 +37,27 @@ import GHC.Core.DataCon
, StrictnessMark (..) )
import GHC.Core.Op.Monad ( Tick(..), SimplMode(..) )
import GHC.Core
-import Demand ( StrictSig(..), dmdTypeDepth, isStrictDmd
+import GHC.Types.Demand ( StrictSig(..), dmdTypeDepth, isStrictDmd
, mkClosedStrictSig, topDmd, botDiv )
-import Cpr ( mkCprSig, botCpr )
+import GHC.Types.Cpr ( mkCprSig, botCpr )
import GHC.Core.Ppr ( pprCoreExpr )
import GHC.Core.Unfold
import GHC.Core.Utils
import GHC.Core.SimpleOpt ( pushCoTyArg, pushCoValArg
, joinPointBinding_maybe, joinPointBindings_maybe )
import GHC.Core.Rules ( mkRuleInfo, lookupRule, getRules )
-import BasicTypes ( TopLevelFlag(..), isNotTopLevel, isTopLevel,
+import GHC.Types.Basic ( TopLevelFlag(..), isNotTopLevel, isTopLevel,
RecFlag(..), Arity )
import MonadUtils ( mapAccumLM, liftIO )
-import Var ( isTyCoVar )
+import GHC.Types.Var ( isTyCoVar )
import Maybes ( orElse )
import Control.Monad
import Outputable
import FastString
import Util
import ErrUtils
-import Module ( moduleName, pprModuleName )
-import PrimOp ( PrimOp (SeqOp) )
+import GHC.Types.Module ( moduleName, pprModuleName )
+import PrimOp ( PrimOp (SeqOp) )
{-
@@ -474,7 +474,7 @@ prepareRhs mode top_lvl occ _ rhs0
= return (is_exp, emptyLetFloats, Var fun)
where
is_exp = isExpandableApp fun n_val_args -- The fun a constructor or PAP
- -- See Note [CONLIKE pragma] in BasicTypes
+ -- See Note [CONLIKE pragma] in GHC.Types.Basic
-- The definition of is_exp should match that in
-- OccurAnal.occAnalApp
@@ -2139,7 +2139,7 @@ If you find a match, rewrite it, and apply to 'rhs'.
Notice that we can simply drop casts on the fly here, which
makes it more likely that a rule will match.
-See Note [User-defined RULES for seq] in MkId.
+See Note [User-defined RULES for seq] in GHC.Types.Id.Make.
Note [Occurrence-analyse after rule firing]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -2533,7 +2533,7 @@ rebuildCase env scrut case_bndr alts@[(_, bndrs, rhs)] cont
-- 2c. Try the seq rules if
-- a) it binds only the case binder
-- b) a rule for seq applies
- -- See Note [User-defined RULES for seq] in MkId
+ -- See Note [User-defined RULES for seq] in GHC.Types.Id.Make
| is_plain_seq
= do { mb_rule <- trySeqRules env scrut rhs cont
; case mb_rule of
@@ -2757,7 +2757,7 @@ a case pattern. This is *important*. Consider
We really must record that b is already evaluated so that we don't
go and re-evaluate it when constructing the result.
-See Note [Data-con worker strictness] in MkId.hs
+See Note [Data-con worker strictness] in GHC.Types.Id.Make
NB: simplLamBndrs preserves this eval info
diff --git a/compiler/GHC/Core/Op/Simplify/Driver.hs b/compiler/GHC/Core/Op/Simplify/Driver.hs
index b6ec392599..1b7bb0d1e3 100644
--- a/compiler/GHC/Core/Op/Simplify/Driver.hs
+++ b/compiler/GHC/Core/Op/Simplify/Driver.hs
@@ -21,7 +21,7 @@ import GHC.Core.Rules ( mkRuleBase, unionRuleBase,
getRules )
import GHC.Core.Ppr ( pprCoreBindings, pprCoreExpr )
import GHC.Core.Op.OccurAnal ( occurAnalysePgm, occurAnalyseExpr )
-import IdInfo
+import GHC.Types.Id.Info
import GHC.Core.Stats ( coreBindsSize, coreBindsStats, exprSize )
import GHC.Core.Utils ( mkTicks, stripTicksTop )
import GHC.Core.Lint ( endPass, lintPassResult, dumpPassResult,
@@ -35,11 +35,11 @@ import qualified ErrUtils as Err
import GHC.Core.Op.FloatIn ( floatInwards )
import GHC.Core.Op.FloatOut ( floatOutwards )
import GHC.Core.FamInstEnv
-import Id
+import GHC.Types.Id
import ErrUtils ( withTiming, withTimingD, DumpFormat (..) )
-import BasicTypes ( CompilerPhase(..), isDefaultInlinePragma, defaultInlinePragma )
-import VarSet
-import VarEnv
+import GHC.Types.Basic ( CompilerPhase(..), isDefaultInlinePragma, defaultInlinePragma )
+import GHC.Types.Var.Set
+import GHC.Types.Var.Env
import GHC.Core.Op.LiberateCase ( liberateCase )
import GHC.Core.Op.StaticArgs ( doStaticArgs )
import GHC.Core.Op.Specialise ( specProgram)
@@ -49,14 +49,14 @@ import GHC.Core.Op.CprAnal ( cprAnalProgram )
import GHC.Core.Op.CallArity ( callArityAnalProgram )
import GHC.Core.Op.Exitify ( exitifyProgram )
import GHC.Core.Op.WorkWrap ( wwTopBinds )
-import SrcLoc
+import GHC.Types.SrcLoc
import Util
-import Module
+import GHC.Types.Module
import GHC.Driver.Plugins ( withPlugins, installCoreToDos )
import GHC.Runtime.Loader -- ( initializePlugins )
-import UniqSupply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply )
-import UniqFM
+import GHC.Types.Unique.Supply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply )
+import GHC.Types.Unique.FM
import Outputable
import Control.Monad
import qualified GHC.LanguageExtensions as LangExt
diff --git a/compiler/GHC/Core/Op/Simplify/Env.hs b/compiler/GHC/Core/Op/Simplify/Env.hs
index 0e94f734af..47b95da59e 100644
--- a/compiler/GHC/Core/Op/Simplify/Env.hs
+++ b/compiler/GHC/Core/Op/Simplify/Env.hs
@@ -51,11 +51,11 @@ import GHC.Core.Op.Simplify.Monad
import GHC.Core.Op.Monad ( SimplMode(..) )
import GHC.Core
import GHC.Core.Utils
-import Var
-import VarEnv
-import VarSet
+import GHC.Types.Var
+import GHC.Types.Var.Env
+import GHC.Types.Var.Set
import OrdList
-import Id
+import GHC.Types.Id as Id
import GHC.Core.Make ( mkWildValBinder )
import GHC.Driver.Session ( DynFlags )
import TysWiredIn
@@ -63,11 +63,11 @@ import qualified GHC.Core.Type as Type
import GHC.Core.Type hiding ( substTy, substTyVar, substTyVarBndr, extendTvSubst, extendCvSubst )
import qualified GHC.Core.Coercion as Coercion
import GHC.Core.Coercion hiding ( substCo, substCoVar, substCoVarBndr )
-import BasicTypes
+import GHC.Types.Basic
import MonadUtils
import Outputable
import Util
-import UniqFM ( pprUniqFM )
+import GHC.Types.Unique.FM ( pprUniqFM )
import Data.List (mapAccumL)
diff --git a/compiler/GHC/Core/Op/Simplify/Monad.hs b/compiler/GHC/Core/Op/Simplify/Monad.hs
index e6b23734c4..d45dd13510 100644
--- a/compiler/GHC/Core/Op/Simplify/Monad.hs
+++ b/compiler/GHC/Core/Op/Simplify/Monad.hs
@@ -22,14 +22,14 @@ module GHC.Core.Op.Simplify.Monad (
import GhcPrelude
-import Var ( Var, isId, mkLocalVar )
-import Name ( mkSystemVarName )
-import Id ( Id, mkSysLocalOrCoVar )
-import IdInfo ( IdDetails(..), vanillaIdInfo, setArityInfo )
+import GHC.Types.Var ( Var, isId, mkLocalVar )
+import GHC.Types.Name ( mkSystemVarName )
+import GHC.Types.Id ( Id, mkSysLocalOrCoVar )
+import GHC.Types.Id.Info ( IdDetails(..), vanillaIdInfo, setArityInfo )
import GHC.Core.Type ( Type, mkLamTypes )
import GHC.Core.FamInstEnv ( FamInstEnv )
import GHC.Core ( RuleEnv(..) )
-import UniqSupply
+import GHC.Types.Unique.Supply
import GHC.Driver.Session
import GHC.Core.Op.Monad
import Outputable
@@ -38,7 +38,7 @@ import MonadUtils
import ErrUtils as Err
import Util ( count )
import Panic (throwGhcExceptionIO, GhcException (..))
-import BasicTypes ( IntWithInf, treatZeroAsInf, mkIntWithInf )
+import GHC.Types.Basic ( IntWithInf, treatZeroAsInf, mkIntWithInf )
import Control.Monad ( ap )
{-
diff --git a/compiler/GHC/Core/Op/Simplify/Utils.hs b/compiler/GHC/Core/Op/Simplify/Utils.hs
index 5fb9ddcee4..4b85bff280 100644
--- a/compiler/GHC/Core/Op/Simplify/Utils.hs
+++ b/compiler/GHC/Core/Op/Simplify/Utils.hs
@@ -51,17 +51,17 @@ import GHC.Core.FVs
import GHC.Core.Utils
import GHC.Core.Arity
import GHC.Core.Unfold
-import Name
-import Id
-import IdInfo
-import Var
-import Demand
+import GHC.Types.Name
+import GHC.Types.Id
+import GHC.Types.Id.Info
+import GHC.Types.Var
+import GHC.Types.Demand
import GHC.Core.Op.Simplify.Monad
import GHC.Core.Type hiding( substTy )
import GHC.Core.Coercion hiding( substCo )
import GHC.Core.DataCon ( dataConWorkId, isNullaryRepDataCon )
-import VarSet
-import BasicTypes
+import GHC.Types.Var.Set
+import GHC.Types.Basic
import Util
import OrdList ( isNilOL )
import MonadUtils
@@ -1801,9 +1801,9 @@ abstractFloats dflags top_lvl main_tvs floats body
mk_poly1 :: [TyVar] -> Id -> SimplM (Id, CoreExpr)
mk_poly1 tvs_here var
= do { uniq <- getUniqueM
- ; let poly_name = setNameUnique (idName var) uniq -- Keep same name
+ ; let poly_name = setNameUnique (idName var) uniq -- Keep same name
poly_ty = mkInvForAllTys tvs_here (idType var) -- But new type of course
- poly_id = transferPolyIdInfo var tvs_here $ -- Note [transferPolyIdInfo] in Id.hs
+ poly_id = transferPolyIdInfo var tvs_here $ -- Note [transferPolyIdInfo] in GHC.Types.Id
mkLocalId poly_name poly_ty
; return (poly_id, mkTyApps (Var poly_id) (mkTyVarTys tvs_here)) }
-- In the olden days, it was crucial to copy the occInfo of the original var,
diff --git a/compiler/GHC/Core/Op/SpecConstr.hs b/compiler/GHC/Core/Op/SpecConstr.hs
index 4522e2d23c..0a72edce8d 100644
--- a/compiler/GHC/Core/Op/SpecConstr.hs
+++ b/compiler/GHC/Core/Op/SpecConstr.hs
@@ -29,7 +29,7 @@ import GHC.Core.Utils
import GHC.Core.Unfold ( couldBeSmallEnoughToInline )
import GHC.Core.FVs ( exprsFreeVarsList )
import GHC.Core.Op.Monad
-import Literal ( litIsLifted )
+import GHC.Types.Literal ( litIsLifted )
import GHC.Driver.Types ( ModGuts(..) )
import GHC.Core.Op.WorkWrap.Lib ( isWorkerSmallEnough, mkWorkerArgs )
import GHC.Core.DataCon
@@ -37,30 +37,30 @@ import GHC.Core.Coercion hiding( substCo )
import GHC.Core.Rules
import GHC.Core.Type hiding ( substTy )
import GHC.Core.TyCon ( tyConName )
-import Id
+import GHC.Types.Id
import GHC.Core.Ppr ( pprParendExpr )
import GHC.Core.Make ( mkImpossibleExpr )
-import VarEnv
-import VarSet
-import Name
-import BasicTypes
+import GHC.Types.Var.Env
+import GHC.Types.Var.Set
+import GHC.Types.Name
+import GHC.Types.Basic
import GHC.Driver.Session ( DynFlags(..), GeneralFlag( Opt_SpecConstrKeen )
, gopt, hasPprDebug )
import Maybes ( orElse, catMaybes, isJust, isNothing )
-import Demand
-import Cpr
+import GHC.Types.Demand
+import GHC.Types.Cpr
import GHC.Serialized ( deserializeWithData )
import Util
import Pair
-import UniqSupply
+import GHC.Types.Unique.Supply
import Outputable
import FastString
-import UniqFM
+import GHC.Types.Unique.FM
import MonadUtils
import Control.Monad ( zipWithM )
import Data.List
import PrelNames ( specTyConName )
-import Module
+import GHC.Types.Module
import GHC.Core.TyCon ( TyCon )
import GHC.Exts( SpecConstrAnnotation(..) )
import Data.Ord( comparing )
@@ -2084,7 +2084,7 @@ callToPats env bndr_occs call@(Call _ args con_env)
-- lambdas with different argument orders. See
-- determinism/simplCore/should_compile/spec-inline-determ.hs
-- for an example. For explanation of determinism
- -- considerations See Note [Unique Determinism] in Unique.
+ -- considerations See Note [Unique Determinism] in GHC.Types.Unique.
in_scope_vars = getInScopeVars in_scope
is_in_scope v = v `elemVarSet` in_scope_vars
diff --git a/compiler/GHC/Core/Op/Specialise.hs b/compiler/GHC/Core/Op/Specialise.hs
index 250a0f7313..b43bc90ef1 100644
--- a/compiler/GHC/Core/Op/Specialise.hs
+++ b/compiler/GHC/Core/Op/Specialise.hs
@@ -15,30 +15,30 @@ module GHC.Core.Op.Specialise ( specProgram, specUnfolding ) where
import GhcPrelude
-import Id
+import GHC.Types.Id
import TcType hiding( substTy )
import GHC.Core.Type hiding( substTy, extendTvSubstList )
import GHC.Core.Predicate
-import Module( Module, HasModule(..) )
+import GHC.Types.Module( Module, HasModule(..) )
import GHC.Core.Coercion( Coercion )
import GHC.Core.Op.Monad
import qualified GHC.Core.Subst
import GHC.Core.Unfold
-import Var ( isLocalVar )
-import VarSet
-import VarEnv
+import GHC.Types.Var ( isLocalVar )
+import GHC.Types.Var.Set
+import GHC.Types.Var.Env
import GHC.Core
import GHC.Core.Rules
import GHC.Core.SimpleOpt ( collectBindersPushingCo )
import GHC.Core.Utils ( exprIsTrivial, mkCast, exprType )
import GHC.Core.FVs
import GHC.Core.Arity ( etaExpandToJoinPointRule )
-import UniqSupply
-import Name
-import MkId ( voidArgId, voidPrimId )
+import GHC.Types.Unique.Supply
+import GHC.Types.Name
+import GHC.Types.Id.Make ( voidArgId, voidPrimId )
import Maybes ( mapMaybe, isJust )
import MonadUtils ( foldlM )
-import BasicTypes
+import GHC.Types.Basic
import GHC.Driver.Types
import Bag
import GHC.Driver.Session
@@ -46,7 +46,7 @@ import Util
import Outputable
import FastString
import State
-import UniqDFM
+import GHC.Types.Unique.DFM
import GHC.Core.TyCo.Rep (TyCoBinder (..))
import Control.Monad
@@ -2129,7 +2129,7 @@ emptyUDs = MkUD { ud_binds = emptyBag, ud_calls = emptyDVarEnv }
type CallDetails = DIdEnv CallInfoSet
-- The order of specialized binds and rules depends on how we linearize
-- CallDetails, so to get determinism we must use a deterministic set here.
- -- See Note [Deterministic UniqFM] in UniqDFM
+ -- See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM
data CallInfoSet = CIS Id (Bag CallInfo)
-- The list of types and dictionaries is guaranteed to
diff --git a/compiler/GHC/Core/Op/StaticArgs.hs b/compiler/GHC/Core/Op/StaticArgs.hs
index e550fabfd9..835f1ffbaa 100644
--- a/compiler/GHC/Core/Op/StaticArgs.hs
+++ b/compiler/GHC/Core/Op/StaticArgs.hs
@@ -53,20 +53,20 @@ module GHC.Core.Op.StaticArgs ( doStaticArgs ) where
import GhcPrelude
-import Var
+import GHC.Types.Var
import GHC.Core
import GHC.Core.Utils
import GHC.Core.Type
import GHC.Core.Coercion
-import Id
-import Name
-import VarEnv
-import UniqSupply
+import GHC.Types.Id
+import GHC.Types.Name
+import GHC.Types.Var.Env
+import GHC.Types.Unique.Supply
import Util
-import UniqFM
-import VarSet
-import Unique
-import UniqSet
+import GHC.Types.Unique.FM
+import GHC.Types.Var.Set
+import GHC.Types.Unique
+import GHC.Types.Unique.Set
import Outputable
import Data.List (mapAccumL)
diff --git a/compiler/GHC/Core/Op/Tidy.hs b/compiler/GHC/Core/Op/Tidy.hs
index 758c1daf6c..4759efa0e9 100644
--- a/compiler/GHC/Core/Op/Tidy.hs
+++ b/compiler/GHC/Core/Op/Tidy.hs
@@ -19,16 +19,16 @@ import GhcPrelude
import GHC.Core
import GHC.Core.Seq ( seqUnfolding )
-import Id
-import IdInfo
-import Demand ( zapUsageEnvSig )
+import GHC.Types.Id
+import GHC.Types.Id.Info
+import GHC.Types.Demand ( zapUsageEnvSig )
import GHC.Core.Type ( tidyType, tidyVarBndr )
import GHC.Core.Coercion ( tidyCo )
-import Var
-import VarEnv
-import UniqFM
-import Name hiding (tidyNameOcc)
-import SrcLoc
+import GHC.Types.Var
+import GHC.Types.Var.Env
+import GHC.Types.Unique.FM
+import GHC.Types.Name hiding (tidyNameOcc)
+import GHC.Types.SrcLoc
import Maybes
import Data.List
@@ -277,7 +277,7 @@ We keep the OneShotInfo because we want it to propagate into the interface.
Not all OneShotInfo is determined by a compiler analysis; some is added by a
call of GHC.Exts.oneShot, which is then discarded before the end of the
optimisation pipeline, leaving only the OneShotInfo on the lambda. Hence we
-must preserve this info in inlinings. See Note [The oneShot function] in MkId.
+must preserve this info in inlinings. See Note [The oneShot function] in GHC.Types.Id.Make.
This applies to lambda binders only, hence it is stored in IfaceLamBndr.
-}
diff --git a/compiler/GHC/Core/Op/WorkWrap.hs b/compiler/GHC/Core/Op/WorkWrap.hs
index 241a295899..6abfb4733c 100644
--- a/compiler/GHC/Core/Op/WorkWrap.hs
+++ b/compiler/GHC/Core/Op/WorkWrap.hs
@@ -14,15 +14,15 @@ import GHC.Core
import GHC.Core.Unfold ( certainlyWillInline, mkWwInlineRule, mkWorkerUnfolding )
import GHC.Core.Utils ( exprType, exprIsHNF )
import GHC.Core.FVs ( exprFreeVars )
-import Var
-import Id
-import IdInfo
+import GHC.Types.Var
+import GHC.Types.Id
+import GHC.Types.Id.Info
import GHC.Core.Type
-import UniqSupply
-import BasicTypes
+import GHC.Types.Unique.Supply
+import GHC.Types.Basic
import GHC.Driver.Session
-import Demand
-import Cpr
+import GHC.Types.Demand
+import GHC.Types.Cpr
import GHC.Core.Op.WorkWrap.Lib
import Util
import Outputable
diff --git a/compiler/GHC/Core/Op/WorkWrap/Lib.hs b/compiler/GHC/Core/Op/WorkWrap/Lib.hs
index 3ce454e7a2..6245bb9099 100644
--- a/compiler/GHC/Core/Op/WorkWrap/Lib.hs
+++ b/compiler/GHC/Core/Op/WorkWrap/Lib.hs
@@ -19,28 +19,28 @@ import GhcPrelude
import GHC.Core
import GHC.Core.Utils ( exprType, mkCast, mkDefaultCase, mkSingleAltCase )
-import Id
-import IdInfo ( JoinArity )
+import GHC.Types.Id
+import GHC.Types.Id.Info ( JoinArity )
import GHC.Core.DataCon
-import Demand
-import Cpr
+import GHC.Types.Demand
+import GHC.Types.Cpr
import GHC.Core.Make ( mkAbsentErrorApp, mkCoreUbxTup
, mkCoreApp, mkCoreLet )
-import MkId ( voidArgId, voidPrimId )
+import GHC.Types.Id.Make ( voidArgId, voidPrimId )
import TysWiredIn ( tupleDataCon )
import TysPrim ( voidPrimTy )
-import Literal ( absentLiteralOf, rubbishLit )
-import VarEnv ( mkInScopeSet )
-import VarSet ( VarSet )
+import GHC.Types.Literal ( absentLiteralOf, rubbishLit )
+import GHC.Types.Var.Env ( mkInScopeSet )
+import GHC.Types.Var.Set ( VarSet )
import GHC.Core.Type
import GHC.Core.Predicate ( isClassPred )
import GHC.Types.RepType ( isVoidTy, typePrimRep )
import GHC.Core.Coercion
import GHC.Core.FamInstEnv
-import BasicTypes ( Boxity(..) )
+import GHC.Types.Basic ( Boxity(..) )
import GHC.Core.TyCon
-import UniqSupply
-import Unique
+import GHC.Types.Unique.Supply
+import GHC.Types.Unique
import Maybes
import Util
import Outputable
@@ -957,8 +957,8 @@ deepSplitCprType_maybe _ _ _ = Nothing
findTypeShape :: FamInstEnvs -> Type -> TypeShape
-- Uncover the arrow and product shape of a type
--- The data type TypeShape is defined in Demand
--- See Note [Trimming a demand to a type] in Demand
+-- The data type TypeShape is defined in GHC.Types.Demand
+-- See Note [Trimming a demand to a type] in GHC.Types.Demand
findTypeShape fam_envs ty
| Just (tc, tc_args) <- splitTyConApp_maybe ty
, Just con <- isDataProductTyCon_maybe tc
@@ -1197,7 +1197,7 @@ mk_absent_let dflags fam_envs arg
-- determinism, because with different uniques the strings
-- will have different lengths and hence different costs for
-- the inliner leading to different inlining.
- -- See also Note [Unique Determinism] in Unique
+ -- See also Note [Unique Determinism] in GHC.Types.Unique
unlifted_rhs = mkTyApps (Lit rubbishLit) [arg_ty]
mk_ww_local :: Unique -> (Type, StrictnessMark) -> Id