diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-03-02 11:43:03 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-03-16 23:53:24 -0400 |
commit | 18a346a4b5a02b8c62e8eedb91b35c2d8e754b96 (patch) | |
tree | 59121ffd5a46c1987a184db3842a3089f6250d11 /compiler/typecheck | |
parent | 818b3c38e7548f4720815f76969238d82c9650f7 (diff) | |
download | haskell-18a346a4b5a02b8c62e8eedb91b35c2d8e754b96.tar.gz |
Modules: Core (#13009)
Update submodule: haddock
Diffstat (limited to 'compiler/typecheck')
51 files changed, 379 insertions, 378 deletions
diff --git a/compiler/typecheck/ClsInst.hs b/compiler/typecheck/ClsInst.hs index b112bff74a..8669c9d9bb 100644 --- a/compiler/typecheck/ClsInst.hs +++ b/compiler/typecheck/ClsInst.hs @@ -19,10 +19,10 @@ import TcType import TcTypeable import TcMType import TcEvidence -import Predicate +import GHC.Core.Predicate import GHC.Rename.Env( addUsedGRE ) import RdrName( lookupGRE_FieldLabel ) -import InstEnv +import GHC.Core.InstEnv import Inst( instDFunType ) import FamInst( tcGetFamInstEnvs, tcInstNewTyCon_maybe, tcLookupDataFamInst ) @@ -31,14 +31,14 @@ import TysPrim( eqPrimTyCon, eqReprPrimTyCon ) import PrelNames import Id -import Type +import GHC.Core.Type import GHC.Core.Make ( mkStringExprFS, mkNaturalExpr ) import Name ( Name, pprDefinedAt ) import VarEnv ( VarEnv ) -import DataCon -import TyCon -import Class +import GHC.Core.DataCon +import GHC.Core.TyCon +import GHC.Core.Class import GHC.Driver.Session import Outputable import Util( splitAtList, fstOf3 ) @@ -200,7 +200,7 @@ matchInstEnv dflags short_cut_solver clas tys pred = mkClassPred clas tys match_one :: SafeOverlapping -> DFunId -> [DFunInstType] -> TcM ClsInstResult - -- See Note [DFunInstType: instantiating types] in InstEnv + -- See Note [DFunInstType: instantiating types] in GHC.Core.InstEnv match_one so dfun_id mb_inst_tys = do { traceTc "match_one" (ppr dfun_id $$ ppr mb_inst_tys) ; (tys, theta) <- instDFunType dfun_id mb_inst_tys diff --git a/compiler/typecheck/Constraint.hs b/compiler/typecheck/Constraint.hs index c0eefe72b2..4855b5c57c 100644 --- a/compiler/typecheck/Constraint.hs +++ b/compiler/typecheck/Constraint.hs @@ -80,11 +80,11 @@ import GhcPrelude import {-# SOURCE #-} TcRnTypes ( TcLclEnv, setLclEnvTcLevel, getLclEnvTcLevel , setLclEnvLoc, getLclEnvLoc ) -import Predicate -import Type -import Coercion -import Class -import TyCon +import GHC.Core.Predicate +import GHC.Core.Type +import GHC.Core.Coercion +import GHC.Core.Class +import GHC.Core.TyCon import Var import TcType @@ -93,7 +93,7 @@ import TcOrigin import GHC.Core -import TyCoPpr +import GHC.Core.TyCo.Ppr import OccName import FV import VarSet @@ -1344,7 +1344,7 @@ data TcEvDest | HoleDest CoercionHole -- ^ fill in this hole with the evidence -- HoleDest is always used for type-equalities - -- See Note [Coercion holes] in TyCoRep + -- See Note [Coercion holes] in GHC.Core.TyCo.Rep data CtEvidence = CtGiven -- Truly given, not depending on subgoals diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs index eb86ec0284..1b46b98636 100644 --- a/compiler/typecheck/FamInst.hs +++ b/compiler/typecheck/FamInst.hs @@ -16,27 +16,27 @@ module FamInst ( import GhcPrelude import GHC.Driver.Types -import FamInstEnv -import InstEnv( roughMatchTcs ) -import Coercion +import GHC.Core.FamInstEnv +import GHC.Core.InstEnv( roughMatchTcs ) +import GHC.Core.Coercion import GHC.Core.Lint import TcEvidence import GHC.Iface.Load import TcRnMonad import SrcLoc -import TyCon +import GHC.Core.TyCon import TcType -import CoAxiom +import GHC.Core.Coercion.Axiom import GHC.Driver.Session import Module import Outputable import Util import RdrName -import DataCon ( dataConName ) +import GHC.Core.DataCon ( dataConName ) import Maybes -import TyCoRep -import TyCoFVs -import TyCoPpr ( pprWithExplicitKindsWhen ) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr ( pprWithExplicitKindsWhen ) import TcMType import Name import Panic @@ -524,7 +524,7 @@ tcLookupDataFamInst_maybe fam_inst_envs tc tc_args , let rep_tc = dataFamInstRepTyCon rep_fam co = mkUnbranchedAxInstCo Representational ax rep_args (mkCoVarCos cvs) - = ASSERT( null rep_cos ) -- See Note [Constrained family instances] in FamInstEnv + = ASSERT( null rep_cos ) -- See Note [Constrained family instances] in GHC.Core.FamInstEnv Just (rep_tc, rep_args, co) | otherwise @@ -659,7 +659,7 @@ the current module. -- Check that the proposed new instance is OK, -- and then add it to the home inst env -- This must be lazy in the fam_inst arguments, see Note [Lazy axiom match] --- in FamInstEnv.hs +-- in GHC.Core.FamInstEnv addLocalFamInst :: (FamInstEnv,[FamInst]) -> FamInst -> TcM (FamInstEnv, [FamInst]) @@ -719,7 +719,7 @@ checkForConflicts inst_envs fam_inst ; reportConflictInstErr fam_inst conflicts } checkForInjectivityConflicts :: FamInstEnvs -> FamInst -> TcM () - -- see Note [Verifying injectivity annotation] in FamInstEnv, check 1B1. + -- see Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv, check 1B1. checkForInjectivityConflicts instEnvs famInst | isTypeFamilyTyCon tycon -- as opposed to data family tycon , Injective inj <- tyConInjectivityInfo tycon @@ -736,7 +736,7 @@ checkForInjectivityConflicts instEnvs famInst -- this is possible and False if adding this equation would violate injectivity -- annotation. This looks only at the one equation; it does not look for -- interaction between equations. Use checkForInjectivityConflicts for that. --- Does checks (2)-(4) of Note [Verifying injectivity annotation] in FamInstEnv. +-- Does checks (2)-(4) of Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv. checkInjectiveEquation :: FamInst -> TcM () checkInjectiveEquation famInst | isTypeFamilyTyCon tycon @@ -744,7 +744,7 @@ checkInjectiveEquation famInst , Injective inj <- tyConInjectivityInfo tycon = do { dflags <- getDynFlags ; let axiom = coAxiomSingleBranch fi_ax - -- see Note [Verifying injectivity annotation] in FamInstEnv + -- see Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv ; reportInjectivityErrors dflags fi_ax axiom inj } @@ -921,7 +921,7 @@ unusedInjTvsInRHS :: DynFlags -> ( TyVarSet , Bool -- True <=> one or more variable is used invisibly , Bool ) -- True <=> suggest -XUndecidableInstances --- See Note [Verifying injectivity annotation] in FamInstEnv. +-- See Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv. -- This function implements check (4) described there, further -- described in Note [Coverage condition for injective type families]. -- In theory (and modulo the -XUndecidableInstances wrinkle), diff --git a/compiler/typecheck/FunDeps.hs b/compiler/typecheck/FunDeps.hs index 81c3ff4c7a..f8cda0f289 100644 --- a/compiler/typecheck/FunDeps.hs +++ b/compiler/typecheck/FunDeps.hs @@ -23,17 +23,17 @@ import GhcPrelude import Name import Var -import Class -import Predicate -import Type +import GHC.Core.Class +import GHC.Core.Predicate +import GHC.Core.Type import TcType( transSuperClasses ) -import CoAxiom( TypeEqn ) -import Unify -import InstEnv +import GHC.Core.Coercion.Axiom( TypeEqn ) +import GHC.Core.Unify +import GHC.Core.InstEnv import VarSet import VarEnv -import TyCoFVs -import TyCoPpr( pprWithExplicitKindsWhen ) +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr( pprWithExplicitKindsWhen ) import FV import Outputable import ErrUtils( Validity(..), allValid ) diff --git a/compiler/typecheck/Inst.hs b/compiler/typecheck/Inst.hs index 96b387b7ec..741be62e03 100644 --- a/compiler/typecheck/Inst.hs +++ b/compiler/typecheck/Inst.hs @@ -46,27 +46,27 @@ import GHC.Hs import TcHsSyn import TcRnMonad import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import TcEnv import TcEvidence -import InstEnv +import GHC.Core.InstEnv import TysWiredIn ( heqDataCon, eqDataCon ) import GHC.Core ( isOrphan ) import FunDeps import TcMType -import Type -import TyCoRep -import TyCoPpr ( debugPprType ) +import GHC.Core.Type +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr ( debugPprType ) import TcType import GHC.Driver.Types -import Class( Class ) +import GHC.Core.Class( Class ) import MkId( mkDictFunId ) import GHC.Core( Expr(..) ) -- For the Coercion constructor import Id import Name import Var ( EvVar, tyVarName, VarBndr(..) ) -import DataCon +import GHC.Core.DataCon import VarEnv import PrelNames import SrcLoc @@ -385,7 +385,7 @@ instCallConstraints orig preds instDFunType :: DFunId -> [DFunInstType] -> TcM ( [TcType] -- instantiated argument types , TcThetaType ) -- instantiated constraint --- See Note [DFunInstType: instantiating types] in InstEnv +-- See Note [DFunInstType: instantiating types] in GHC.Core.InstEnv instDFunType dfun_id dfun_inst_tys = do { (subst, inst_tys) <- go empty_subst dfun_tvs dfun_inst_tys ; return (inst_tys, substTheta subst dfun_theta) } @@ -454,14 +454,14 @@ tcInstInvisibleTyBinder subst (Named (Bndr tv _)) tcInstInvisibleTyBinder subst (Anon af ty) | Just (mk, k1, k2) <- get_eq_tys_maybe (substTy subst ty) -- Equality is the *only* constraint currently handled in types. - -- See Note [Constraints in kinds] in TyCoRep + -- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep = ASSERT( af == InvisArg ) do { co <- unifyKind Nothing k1 k2 ; arg' <- mk co ; return (subst, arg') } | otherwise -- This should never happen - -- See TyCoRep Note [Constraints in kinds] + -- See GHC.Core.TyCo.Rep Note [Constraints in kinds] = pprPanic "tcInvisibleTyBinder" (ppr ty) ------------------------------- @@ -472,7 +472,7 @@ get_eq_tys_maybe :: Type , Type -- t1 , Type -- t2 ) --- See Note [Constraints in kinds] in TyCoRep +-- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep get_eq_tys_maybe ty -- Lifted heterogeneous equality (~~) | Just (tc, [_, _, k1, k2]) <- splitTyConApp_maybe ty diff --git a/compiler/typecheck/TcBackpack.hs b/compiler/typecheck/TcBackpack.hs index 81445f1291..954ee6c24d 100644 --- a/compiler/typecheck/TcBackpack.hs +++ b/compiler/typecheck/TcBackpack.hs @@ -27,8 +27,8 @@ import GHC.Hs import RdrName import TcRnMonad import TcTyDecls -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import Inst import GHC.IfaceToCore import TcMType @@ -48,7 +48,7 @@ import Avail import SrcLoc import GHC.Driver.Types import Outputable -import Type +import GHC.Core.Type import FastString import GHC.Rename.Fixity ( lookupFixityRn ) import Maybes diff --git a/compiler/typecheck/TcBinds.hs b/compiler/typecheck/TcBinds.hs index 594fe3030b..49b4f92ce1 100644 --- a/compiler/typecheck/TcBinds.hs +++ b/compiler/typecheck/TcBinds.hs @@ -35,11 +35,11 @@ import TcEvidence import TcHsType import TcPat import TcMType -import FamInstEnv( normaliseType ) +import GHC.Core.FamInstEnv( normaliseType ) import FamInst( tcGetFamInstEnvs ) -import TyCon +import GHC.Core.TyCon import TcType -import Type( mkStrLitTy, tidyOpenType, splitTyConApp_maybe, mkCastTy) +import GHC.Core.Type (mkStrLitTy, tidyOpenType, splitTyConApp_maybe, mkCastTy) import TysPrim import TysWiredIn( mkBoxedTupleTy ) import Id @@ -63,7 +63,7 @@ import TcValidity (checkValidType) import UniqFM import UniqSet import qualified GHC.LanguageExtensions as LangExt -import ConLike +import GHC.Core.ConLike import Control.Monad import Data.Foldable (find) diff --git a/compiler/typecheck/TcCanonical.hs b/compiler/typecheck/TcCanonical.hs index 35900f0167..33b15aa292 100644 --- a/compiler/typecheck/TcCanonical.hs +++ b/compiler/typecheck/TcCanonical.hs @@ -14,22 +14,22 @@ module TcCanonical( import GhcPrelude import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import TcUnify( swapOverTyVars, metaTyVarUpdateOK ) import TcType -import Type +import GHC.Core.Type import TcFlatten import TcSMonad import TcEvidence import TcEvTerm -import Class -import TyCon -import TyCoRep -- cleverly decomposes types, good for completeness checking -import Coercion +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep -- cleverly decomposes types, good for completeness checking +import GHC.Core.Coercion import GHC.Core import Id( idType, mkTemplateLocals ) -import FamInstEnv ( FamInstEnvs ) +import GHC.Core.FamInstEnv ( FamInstEnvs ) import FamInst ( tcTopNormaliseNewTypeTF_maybe ) import Var import VarEnv( mkInScopeSet ) @@ -694,7 +694,7 @@ case. Instead we have a special case in TcInteract.doTopReactOther, which looks for primitive equalities specially in the quantified constraints. -See also Note [Evidence for quantified constraints] in Predicate. +See also Note [Evidence for quantified constraints] in GHC.Core.Predicate. ************************************************************************ @@ -1652,7 +1652,7 @@ Conclusion: It all comes from the fact that newtypes aren't necessarily injective w.r.t. representational equality. -Furthermore, as explained in Note [NthCo and newtypes] in TyCoRep, we can't use +Furthermore, as explained in Note [NthCo and newtypes] in GHC.Core.TyCo.Rep, we can't use NthCo on representational coercions over newtypes. NthCo comes into play only when decomposing givens. diff --git a/compiler/typecheck/TcClassDcl.hs b/compiler/typecheck/TcClassDcl.hs index 83750c4d47..dad787b93a 100644 --- a/compiler/typecheck/TcClassDcl.hs +++ b/compiler/typecheck/TcClassDcl.hs @@ -32,18 +32,18 @@ import TcBinds import TcUnify import TcHsType import TcMType -import Type ( piResultTys ) -import Predicate +import GHC.Core.Type ( piResultTys ) +import GHC.Core.Predicate import TcOrigin import TcType import TcRnMonad import GHC.Driver.Phases (HscSource(..)) import BuildTyCl( TcMethInfo ) -import Class -import Coercion ( pprCoAxiom ) +import GHC.Core.Class +import GHC.Core.Coercion ( pprCoAxiom ) import GHC.Driver.Session import FamInst -import FamInstEnv +import GHC.Core.FamInstEnv import Id import Name import NameEnv @@ -52,7 +52,7 @@ import Var import VarEnv import Outputable import SrcLoc -import TyCon +import GHC.Core.TyCon import Maybes import BasicTypes import Bag diff --git a/compiler/typecheck/TcDefaults.hs b/compiler/typecheck/TcDefaults.hs index a204486147..535f7a7769 100644 --- a/compiler/typecheck/TcDefaults.hs +++ b/compiler/typecheck/TcDefaults.hs @@ -11,7 +11,7 @@ module TcDefaults ( tcDefaults ) where import GhcPrelude import GHC.Hs -import Class +import GHC.Core.Class import TcRnMonad import TcEnv import TcHsType diff --git a/compiler/typecheck/TcDeriv.hs b/compiler/typecheck/TcDeriv.hs index 711a30117e..d002d55f5d 100644 --- a/compiler/typecheck/TcDeriv.hs +++ b/compiler/typecheck/TcDeriv.hs @@ -24,7 +24,7 @@ import GHC.Driver.Session import TcRnMonad import FamInst import TcOrigin -import Predicate +import GHC.Core.Predicate import TcDerivInfer import TcDerivUtils import TcValidity( allDistinctTyVars ) @@ -32,12 +32,12 @@ import TcClassDcl( instDeclCtxt3, tcATDefault ) import TcEnv import TcGenDeriv -- Deriv stuff import TcValidity( checkValidInstHead ) -import InstEnv +import GHC.Core.InstEnv import Inst -import FamInstEnv +import GHC.Core.FamInstEnv import TcHsType -import TyCoRep -import TyCoPpr ( pprTyVars ) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr ( pprTyVars ) import GHC.Rename.Names ( extendGlobalRdrEnvRn ) import GHC.Rename.Binds @@ -45,16 +45,16 @@ import GHC.Rename.Env import GHC.Rename.Source ( addTcgDUs ) import Avail -import Unify( tcUnifyTy ) -import Class -import Type +import GHC.Core.Unify( tcUnifyTy ) +import GHC.Core.Class +import GHC.Core.Type import ErrUtils -import DataCon +import GHC.Core.DataCon import Maybes import RdrName import Name import NameSet -import TyCon +import GHC.Core.TyCon import TcType import Var import VarEnv @@ -886,7 +886,7 @@ from DataFamInstTyCon: TyCon -- The family TyCon [Type] -- Argument types (mentions the tyConTyVars of this TyCon) -- No shorter in length than the tyConTyVars of the family TyCon - -- How could it be longer? See [Arity of data families] in FamInstEnv + -- How could it be longer? See [Arity of data families] in GHC.Core.FamInstEnv Notice that the arg tys might not be the same as the family tycon arity (= length tyConTyVars). @@ -1312,7 +1312,7 @@ write it out return x = MkT [x] ... etc ... -See Note [Eta reduction for data families] in FamInstEnv +See Note [Eta reduction for data families] in GHC.Core.FamInstEnv %************************************************************************ %* * diff --git a/compiler/typecheck/TcDerivInfer.hs b/compiler/typecheck/TcDerivInfer.hs index a880916674..4ce31b8918 100644 --- a/compiler/typecheck/TcDerivInfer.hs +++ b/compiler/typecheck/TcDerivInfer.hs @@ -17,8 +17,8 @@ import GhcPrelude import Bag import BasicTypes -import Class -import DataCon +import GHC.Core.Class +import GHC.Core.DataCon import ErrUtils import Inst import Outputable @@ -33,16 +33,16 @@ import TcMType import TcRnMonad import TcOrigin import Constraint -import Predicate +import GHC.Core.Predicate import TcType -import TyCon -import TyCoPpr (pprTyVars) -import Type +import GHC.Core.TyCon +import GHC.Core.TyCo.Ppr (pprTyVars) +import GHC.Core.Type import TcSimplify import TcValidity (validDerivPred) import TcUnify (buildImplicationFor, checkConstraints) import TysWiredIn (typeToTypeKind) -import Unify (tcUnifyTy) +import GHC.Core.Unify (tcUnifyTy) import Util import Var import VarSet diff --git a/compiler/typecheck/TcDerivUtils.hs b/compiler/typecheck/TcDerivUtils.hs index 9ff82eee84..c998ea0ee9 100644 --- a/compiler/typecheck/TcDerivUtils.hs +++ b/compiler/typecheck/TcDerivUtils.hs @@ -27,14 +27,14 @@ import GhcPrelude import Bag import BasicTypes -import Class -import DataCon +import GHC.Core.Class +import GHC.Core.DataCon import GHC.Driver.Session import ErrUtils import GHC.Driver.Types (lookupFixity, mi_fix) import GHC.Hs import Inst -import InstEnv +import GHC.Core.InstEnv import GHC.Iface.Load (loadInterfaceForName) import Module (getModule) import Name @@ -48,9 +48,9 @@ import TcOrigin import TcRnMonad import TcType import THNames (liftClassKey) -import TyCon -import TyCoPpr (pprSourceTyCon) -import Type +import GHC.Core.TyCon +import GHC.Core.TyCo.Ppr (pprSourceTyCon) +import GHC.Core.Type import Util import VarSet @@ -912,7 +912,7 @@ cond_isEnumeration _ _ rep_tc why = sep [ quotes (pprSourceTyCon rep_tc) <+> text "must be an enumeration type" , text "(an enumeration consists of one or more nullary, non-GADT constructors)" ] - -- See Note [Enumeration types] in TyCon + -- See Note [Enumeration types] in GHC.Core.TyCon cond_isProduct :: Condition cond_isProduct _ _ rep_tc diff --git a/compiler/typecheck/TcEnv.hs b/compiler/typecheck/TcEnv.hs index 71ca0044ad..98fb6a388c 100644 --- a/compiler/typecheck/TcEnv.hs +++ b/compiler/typecheck/TcEnv.hs @@ -84,14 +84,14 @@ import TysWiredIn import Id import Var import RdrName -import InstEnv -import DataCon ( DataCon ) -import PatSyn ( PatSyn ) -import ConLike -import TyCon -import Type -import CoAxiom -import Class +import GHC.Core.InstEnv +import GHC.Core.DataCon ( DataCon ) +import GHC.Core.PatSyn ( PatSyn ) +import GHC.Core.ConLike +import GHC.Core.TyCon +import GHC.Core.Type +import GHC.Core.Coercion.Axiom +import GHC.Core.Class import Name import NameSet import NameEnv diff --git a/compiler/typecheck/TcErrors.hs b/compiler/typecheck/TcErrors.hs index 2d0104f434..ea859bf3a8 100644 --- a/compiler/typecheck/TcErrors.hs +++ b/compiler/typecheck/TcErrors.hs @@ -20,25 +20,25 @@ import GhcPrelude import TcRnTypes import TcRnMonad import Constraint -import Predicate +import GHC.Core.Predicate import TcMType import TcUnify( occCheckForErrors, MetaTyVarUpdateResult(..) ) import TcEnv( tcInitTidyEnv ) import TcType import TcOrigin import GHC.Rename.Unbound ( unknownNameSuggestions ) -import Type -import TyCoRep -import TyCoPpr ( pprTyVars, pprWithExplicitKindsWhen, pprSourceTyCon, pprWithTYPE ) -import Unify ( tcMatchTys ) +import GHC.Core.Type +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr ( pprTyVars, pprWithExplicitKindsWhen, pprSourceTyCon, pprWithTYPE ) +import GHC.Core.Unify ( tcMatchTys ) import Module import FamInst -import FamInstEnv ( flattenTys ) +import GHC.Core.FamInstEnv ( flattenTys ) import Inst -import InstEnv -import TyCon -import Class -import DataCon +import GHC.Core.InstEnv +import GHC.Core.TyCon +import GHC.Core.Class +import GHC.Core.DataCon import TcEvidence import TcEvTerm import GHC.Hs.Binds ( PatSynBind(..) ) @@ -53,7 +53,7 @@ import NameSet import Bag import ErrUtils ( ErrMsg, errDoc, pprLocErrMsg ) import BasicTypes -import ConLike ( ConLike(..)) +import GHC.Core.ConLike ( ConLike(..)) import Util import FastString import Outputable diff --git a/compiler/typecheck/TcEvTerm.hs b/compiler/typecheck/TcEvTerm.hs index 39e03180b7..7eb9c598b4 100644 --- a/compiler/typecheck/TcEvTerm.hs +++ b/compiler/typecheck/TcEvTerm.hs @@ -7,7 +7,7 @@ where import GhcPrelude import FastString -import Type +import GHC.Core.Type import GHC.Core import GHC.Core.Make import Literal ( Literal(..) ) diff --git a/compiler/typecheck/TcEvidence.hs b/compiler/typecheck/TcEvidence.hs index e350ebeac6..9d2661d915 100644 --- a/compiler/typecheck/TcEvidence.hs +++ b/compiler/typecheck/TcEvidence.hs @@ -56,24 +56,24 @@ module TcEvidence ( import GhcPrelude import Var -import CoAxiom -import Coercion +import GHC.Core.Coercion.Axiom +import GHC.Core.Coercion import GHC.Core.Ppr () -- Instance OutputableBndr TyVar import TcType -import Type -import TyCon -import DataCon( DataCon, dataConWrapId ) -import Class( Class ) +import GHC.Core.Type +import GHC.Core.TyCon +import GHC.Core.DataCon( DataCon, dataConWrapId ) +import GHC.Core.Class( Class ) import PrelNames import VarEnv import VarSet -import Predicate +import GHC.Core.Predicate import Name import Pair import GHC.Core -import Class ( classSCSelId ) -import GHC.Core.FVs ( exprSomeFreeVars ) +import GHC.Core.Class ( classSCSelId ) +import GHC.Core.FVs ( exprSomeFreeVars ) import Util import Bag diff --git a/compiler/typecheck/TcExpr.hs b/compiler/typecheck/TcExpr.hs index 688e3797dc..df08106286 100644 --- a/compiler/typecheck/TcExpr.hs +++ b/compiler/typecheck/TcExpr.hs @@ -37,7 +37,7 @@ import TcBinds ( chooseInferredQuantifiers, tcLocalBinds ) import TcSigs ( tcUserTypeSig, tcInstSig ) import TcSimplify ( simplifyInfer, InferMode(..) ) import FamInst ( tcGetFamInstEnvs, tcLookupDataFamInst ) -import FamInstEnv ( FamInstEnvs ) +import GHC.Core.FamInstEnv ( FamInstEnvs ) import GHC.Rename.Env ( addUsedGRE ) import GHC.Rename.Utils ( addNameClashErrRn, unknownSubordinateErr ) import TcEnv @@ -51,18 +51,18 @@ import TcOrigin import TcType import Id import IdInfo -import ConLike -import DataCon -import PatSyn +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.PatSyn import Name import NameEnv import NameSet import RdrName -import TyCon -import TyCoRep -import TyCoPpr -import TyCoSubst (substTyWithInScope) -import Type +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr +import GHC.Core.TyCo.Subst (substTyWithInScope) +import GHC.Core.Type import TcEvidence import VarSet import TysWiredIn @@ -78,7 +78,7 @@ import Maybes import Outputable import FastString import Control.Monad -import Class(classTyCon) +import GHC.Core.Class(classTyCon) import UniqSet ( nonDetEltsUniqSet ) import qualified GHC.LanguageExtensions as LangExt @@ -445,7 +445,7 @@ tcExpr expr@(ExplicitTuple x tup_args boxity) res_ty ; (coi, arg_tys) <- matchExpectedTyConApp tup_tc res_ty -- Unboxed tuples have RuntimeRep vars, which we -- don't care about here - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon ; let arg_tys' = case boxity of Unboxed -> drop arity arg_tys Boxed -> arg_tys ; tup_args1 <- tcTupArgs tup_args arg_tys' @@ -1313,7 +1313,7 @@ We want to reject this type application to Int, but in earlier GHCs we had an ASSERT that Required could not occur here. The ice is thin; c.f. Note [No Required TyCoBinder in terms] -in TyCoRep. +in GHC.Core.TyCo.Rep. Note [VTA for out-of-scope functions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/typecheck/TcFlatten.hs b/compiler/typecheck/TcFlatten.hs index 73c354ef73..f467df06ce 100644 --- a/compiler/typecheck/TcFlatten.hs +++ b/compiler/typecheck/TcFlatten.hs @@ -15,15 +15,15 @@ module TcFlatten( import GhcPrelude import TcRnTypes -import TyCoPpr ( pprTyVar ) +import GHC.Core.TyCo.Ppr ( pprTyVar ) import Constraint -import Predicate +import GHC.Core.Predicate import TcType -import Type +import GHC.Core.Type import TcEvidence -import TyCon -import TyCoRep -- performs delicate algorithm on types -import Coercion +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep -- performs delicate algorithm on types +import GHC.Core.Coercion import Var import VarSet import VarEnv @@ -943,7 +943,7 @@ faster. This doesn't seem quite worth it, yet. Note [flatten_exact_fam_app_fully performance] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The refactor of GRefl seems to cause performance trouble for T9872x: the allocation of flatten_exact_fam_app_fully_performance increased. See note [Generalized reflexive coercion] in TyCoRep for more information about GRefl and #15192 for the current state. +The refactor of GRefl seems to cause performance trouble for T9872x: the allocation of flatten_exact_fam_app_fully_performance increased. See note [Generalized reflexive coercion] in GHC.Core.TyCo.Rep for more information about GRefl and #15192 for the current state. The explicit pattern match in homogenise_result helps with T9872a, b, c. diff --git a/compiler/typecheck/TcForeign.hs b/compiler/typecheck/TcForeign.hs index fb17250806..40bab48fde 100644 --- a/compiler/typecheck/TcForeign.hs +++ b/compiler/typecheck/TcForeign.hs @@ -43,16 +43,16 @@ import TcExpr import TcEnv import FamInst -import FamInstEnv -import Coercion -import Type +import GHC.Core.FamInstEnv +import GHC.Core.Coercion +import GHC.Core.Type import ForeignCall import ErrUtils import Id import Name import RdrName -import DataCon -import TyCon +import GHC.Core.DataCon +import GHC.Core.TyCon import TcType import PrelNames import GHC.Driver.Session @@ -151,7 +151,7 @@ normaliseFfiType' env ty0 = go initRecTc ty0 | isNewTyCon tc -- Expand newtypes , Just rec_nts' <- checkRecTc rec_nts tc - -- See Note [Expanding newtypes] in TyCon.hs + -- See Note [Expanding newtypes] in GHC.Core.TyCon -- We can't just use isRecursiveTyCon; sometimes recursion is ok: -- newtype T = T (Ptr T) -- Here, we don't reject the type for being recursive. diff --git a/compiler/typecheck/TcGenDeriv.hs b/compiler/typecheck/TcGenDeriv.hs index c81d15cf86..a9358be9cf 100644 --- a/compiler/typecheck/TcGenDeriv.hs +++ b/compiler/typecheck/TcGenDeriv.hs @@ -45,7 +45,7 @@ import TcRnMonad import GHC.Hs import RdrName import BasicTypes -import DataCon +import GHC.Core.DataCon import Name import Fingerprint import Encoding @@ -53,21 +53,21 @@ import Encoding import GHC.Driver.Session import PrelInfo import FamInst -import FamInstEnv +import GHC.Core.FamInstEnv import PrelNames import THNames import MkId ( coerceId ) import PrimOp import SrcLoc -import TyCon +import GHC.Core.TyCon import TcEnv import TcType import TcValidity ( checkValidCoAxBranch ) -import CoAxiom ( coAxiomSingleBranch ) +import GHC.Core.Coercion.Axiom ( coAxiomSingleBranch ) import TysPrim import TysWiredIn -import Type -import Class +import GHC.Core.Type +import GHC.Core.Class import VarSet import VarEnv import Util diff --git a/compiler/typecheck/TcGenFunctor.hs b/compiler/typecheck/TcGenFunctor.hs index adb7b6c369..09f252c4bb 100644 --- a/compiler/typecheck/TcGenFunctor.hs +++ b/compiler/typecheck/TcGenFunctor.hs @@ -24,7 +24,7 @@ module TcGenFunctor ( import GhcPrelude import Bag -import DataCon +import GHC.Core.DataCon import FastString import GHC.Hs import Outputable @@ -34,9 +34,9 @@ import SrcLoc import State import TcGenDeriv import TcType -import TyCon -import TyCoRep -import Type +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.Type import Util import Var import VarSet diff --git a/compiler/typecheck/TcGenGenerics.hs b/compiler/typecheck/TcGenGenerics.hs index 146b91dab4..ad7375d2ec 100644 --- a/compiler/typecheck/TcGenGenerics.hs +++ b/compiler/typecheck/TcGenGenerics.hs @@ -19,13 +19,13 @@ module TcGenGenerics (canDoGenerics, canDoGenerics1, import GhcPrelude import GHC.Hs -import Type +import GHC.Core.Type import TcType import TcGenDeriv import TcGenFunctor -import DataCon -import TyCon -import FamInstEnv ( FamInst, FamFlavor(..), mkSingleCoAxiom ) +import GHC.Core.DataCon +import GHC.Core.TyCon +import GHC.Core.FamInstEnv ( FamInst, FamFlavor(..), mkSingleCoAxiom ) import FamInst import Module ( moduleName, moduleNameFS , moduleUnitId, unitIdFS, getModule ) diff --git a/compiler/typecheck/TcHoleErrors.hs b/compiler/typecheck/TcHoleErrors.hs index 17b3c990db..08b4e7c6fc 100644 --- a/compiler/typecheck/TcHoleErrors.hs +++ b/compiler/typecheck/TcHoleErrors.hs @@ -24,8 +24,8 @@ import TcOrigin import TcMType import TcEvidence import TcType -import Type -import DataCon +import GHC.Core.Type +import GHC.Core.DataCon import Name import RdrName ( pprNameProvenance , GlobalRdrElt (..), globalRdrEnvElts ) import PrelNames ( gHC_ERR ) @@ -33,7 +33,7 @@ import Id import VarSet import VarEnv import Bag -import ConLike ( ConLike(..) ) +import GHC.Core.ConLike ( ConLike(..) ) import Util import TcEnv (tcLookup) import Outputable diff --git a/compiler/typecheck/TcHsSyn.hs b/compiler/typecheck/TcHsSyn.hs index 7fbed31dff..307e429b55 100644 --- a/compiler/typecheck/TcHsSyn.hs +++ b/compiler/typecheck/TcHsSyn.hs @@ -53,7 +53,7 @@ import GhcPrelude import GHC.Hs import Id import IdInfo -import Predicate +import GHC.Core.Predicate import TcRnMonad import PrelNames import BuildTyCl ( TcMethInfo, MethInfo ) @@ -61,14 +61,14 @@ import TcType import TcMType import TcEnv ( tcLookupGlobalOnly ) import TcEvidence -import TyCoPpr ( pprTyVar ) +import GHC.Core.TyCo.Ppr ( pprTyVar ) import TysPrim -import TyCon +import GHC.Core.TyCon import TysWiredIn -import Type -import Coercion -import ConLike -import DataCon +import GHC.Core.Type +import GHC.Core.Coercion +import GHC.Core.ConLike +import GHC.Core.DataCon import GHC.Driver.Types import Name import NameEnv diff --git a/compiler/typecheck/TcHsType.hs b/compiler/typecheck/TcHsType.hs index fcf94c5ce5..ac15c36201 100644 --- a/compiler/typecheck/TcHsType.hs +++ b/compiler/typecheck/TcHsType.hs @@ -74,7 +74,7 @@ import GhcPrelude import GHC.Hs import TcRnMonad import TcOrigin -import Predicate +import GHC.Core.Predicate import Constraint import TcEvidence import TcEnv @@ -84,20 +84,20 @@ import TcUnify import GHC.IfaceToCore import TcSimplify import TcHsSyn -import TyCoRep -import TyCoPpr +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr import TcErrors ( reportAllUnsolved ) import TcType import Inst ( tcInstInvisibleTyBinders, tcInstInvisibleTyBinder ) -import Type +import GHC.Core.Type import TysPrim import RdrName( lookupLocalRdrOcc ) import Var import VarSet -import TyCon -import ConLike -import DataCon -import Class +import GHC.Core.TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.Class import Name -- import NameSet import VarEnv @@ -969,7 +969,7 @@ finish_tuple rn_ty tup_sort tau_tys tau_kinds exp_kind = do UnboxedTuple -> let tycon = tupleTyCon Unboxed arity tau_reps = map kindRep tau_kinds - -- See also Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See also Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon arg_tys = tau_reps ++ tau_tys res_kind = unboxedTupleKind tau_reps in check_expected_kind (mkTyConApp tycon arg_tys) res_kind @@ -1541,7 +1541,7 @@ tcTyVar mode name -- Could be a tyvar, a tycon, or a datacon -- We cannot promote a data constructor with a context that contains -- constraints other than equalities, so error if we find one. - -- See Note [Constraints in kinds] in TyCoRep + -- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep dc_theta_illegal_constraint :: ThetaType -> Maybe PredType dc_theta_illegal_constraint = find (not . isEqPred) @@ -2467,7 +2467,7 @@ kcLHsQTyVarBndrs: * The use of tcImplicitQTKBndrs * The tcLookupLocal_maybe code in kc_hs_tv -See Note [Associated type tyvar names] in Class and +See Note [Associated type tyvar names] in GHC.Core.Class and Note [TyVar binders for associated decls] in GHC.Hs.Decls We must do the same for family instance decls, where the in-scope diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index 68fa70256b..39d0cdb0ca 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -37,9 +37,9 @@ import TcOrigin import BuildTyCl import Inst import ClsInst( AssocInstInfo(..), isNotAssociated ) -import InstEnv +import GHC.Core.InstEnv import FamInst -import FamInstEnv +import GHC.Core.FamInstEnv import TcDeriv import TcEnv import TcHsType @@ -47,13 +47,13 @@ import TcUnify import GHC.Core ( Expr(..), mkApps, mkVarApps, mkLams ) import GHC.Core.Make ( nO_METHOD_BINDING_ERROR_ID ) import GHC.Core.Unfold ( mkInlineUnfoldingWithArity, mkDFunUnfolding ) -import Type +import GHC.Core.Type import TcEvidence -import TyCon -import CoAxiom -import DataCon -import ConLike -import Class +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom +import GHC.Core.DataCon +import GHC.Core.ConLike +import GHC.Core.Class import Var import VarEnv import VarSet @@ -311,7 +311,7 @@ Consider this When type-checking the C [a] instance, we need a C [a] dictionary (for the call of op2). If we look up in the instance environment, we find an overlap. And in *general* the right thing is to complain (see Note -[Overlapping instances] in InstEnv). But in *this* case it's wrong to +[Overlapping instances] in GHC.Core.InstEnv). But in *this* case it's wrong to complain, because we just want to delegate to the op2 of this same instance. @@ -660,7 +660,7 @@ tcDataFamInstDecl mb_clsinfo ; checkTc (isDataFamilyTyCon fam_tc) (wrongKindOfFamily fam_tc) ; gadt_syntax <- dataDeclChecks fam_name new_or_data hs_ctxt hs_cons -- Do /not/ check that the number of patterns = tyConArity fam_tc - -- See [Arity of data families] in FamInstEnv + -- See [Arity of data families] in GHC.Core.FamInstEnv ; (qtvs, pats, res_kind, stupid_theta) <- tcDataFamInstHeader mb_clsinfo fam_tc imp_vars mb_bndrs fixity hs_ctxt hs_pats m_ksig hs_cons @@ -684,7 +684,7 @@ tcDataFamInstDecl mb_clsinfo -- kind `TYPE r`, for some `r`. If UnliftedNewtypes is not enabled, we -- go one step further and ensure that it has kind `TYPE 'LiftedRep`. -- - -- See also Note [Arity of data families] in FamInstEnv + -- See also Note [Arity of data families] in GHC.Core.FamInstEnv -- NB: we can do this after eta-reducing the axiom, because if -- we did it before the "extra" tvs from etaExpandAlgTyCon -- would always be eta-reduced @@ -725,7 +725,7 @@ tcDataFamInstDecl mb_clsinfo parent = DataFamInstTyCon axiom fam_tc all_pats -- NB: Use the full ty_binders from the pats. See bullet toward - -- the end of Note [Data type families] in TyCon + -- the end of Note [Data type families] in GHC.Core.TyCon rep_tc = mkAlgTyCon rep_tc_name ty_binders final_res_kind (map (const Nominal) ty_binders) @@ -759,7 +759,7 @@ tcDataFamInstDecl mb_clsinfo ; return (fam_inst, m_deriv_info) } where eta_reduce :: TyCon -> [Type] -> ([Type], [TyConBinder]) - -- See Note [Eta reduction for data families] in FamInstEnv + -- See Note [Eta reduction for data families] in GHC.Core.FamInstEnv -- Splits the incoming patterns into two: the [TyVar] -- are the patterns that can be eta-reduced away. -- e.g. T [a] Int a d c ==> (T [a] Int a, [d,c]) diff --git a/compiler/typecheck/TcInteract.hs b/compiler/typecheck/TcInteract.hs index ce3cc9ffaf..ab98e650ed 100644 --- a/compiler/typecheck/TcInteract.hs +++ b/compiler/typecheck/TcInteract.hs @@ -17,29 +17,29 @@ import TcCanonical import TcFlatten import TcUnify( canSolveByUnification ) import VarSet -import Type -import InstEnv( DFunInstType ) -import CoAxiom( sfInteractTop, sfInteractInert ) +import GHC.Core.Type as Type +import GHC.Core.InstEnv ( DFunInstType ) +import GHC.Core.Coercion.Axiom ( sfInteractTop, sfInteractInert ) import Var import TcType import PrelNames ( coercibleTyConKey, heqTyConKey, eqTyConKey, ipClassKey ) -import CoAxiom ( TypeEqn, CoAxiom(..), CoAxBranch(..), fromBranches ) -import Class -import TyCon +import GHC.Core.Coercion.Axiom ( TypeEqn, CoAxiom(..), CoAxBranch(..), fromBranches ) +import GHC.Core.Class +import GHC.Core.TyCon import FunDeps import FamInst import ClsInst( InstanceWhat(..), safeOverlap ) -import FamInstEnv -import Unify ( tcUnifyTyWithTFs, ruleMatchTyKiX ) +import GHC.Core.FamInstEnv +import GHC.Core.Unify ( tcUnifyTyWithTFs, ruleMatchTyKiX ) import TcEvidence import Outputable import TcRnTypes import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import TcSMonad import Bag @@ -1461,7 +1461,7 @@ We could go further and offer evidence from decomposing injective type-function applications, but that would require new evidence forms, and an extension to FC, so we don't do that right now (Dec 14). -See also Note [Injective type families] in TyCon +See also Note [Injective type families] in GHC.Core.TyCon Note [Cache-caused loops] @@ -1880,7 +1880,7 @@ selection. This avoids having to support quantified constraints whose kind is not Constraint, such as (forall a. F a ~# b) See - * Note [Evidence for quantified constraints] in Predicate + * Note [Evidence for quantified constraints] in GHC.Core.Predicate * Note [Equality superclasses in quantified constraints] in TcCanonical @@ -2634,7 +2634,7 @@ We get [W] Eq (c b), and we must use the local instance to solve it. BUT that wanted also unifies with the top-level Eq [a] instance, and Eq (Maybe a) etc. We want the local instance to "win", otherwise we can't solve the wanted at all. So we mark it as Incohherent. -According to Note [Rules for instance lookup] in InstEnv, that'll +According to Note [Rules for instance lookup] in GHC.Core.InstEnv, that'll make it win even if there are other instances that unify. Moreover this is not a hack! The evidence for this local instance diff --git a/compiler/typecheck/TcMType.hs b/compiler/typecheck/TcMType.hs index 64a6194288..ca6c4b2b7c 100644 --- a/compiler/typecheck/TcMType.hs +++ b/compiler/typecheck/TcMType.hs @@ -97,15 +97,15 @@ module TcMType ( -- friends: import GhcPrelude -import TyCoRep -import TyCoPpr +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr import TcType -import Type -import TyCon -import Coercion -import Class +import GHC.Core.Type +import GHC.Core.TyCon +import GHC.Core.Coercion +import GHC.Core.Class import Var -import Predicate +import GHC.Core.Predicate import TcOrigin -- others: @@ -1432,7 +1432,7 @@ against any specification -- just suboptimal and confounding to users. Note [Recurring into kinds for candidateQTyVars] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -First, read Note [Closing over free variable kinds] in TyCoFVs, paying +First, read Note [Closing over free variable kinds] in GHC.Core.TyCo.FVs, paying attention to the end of the Note about using an empty bound set when traversing a variable's kind. @@ -1449,7 +1449,7 @@ type inference, which is seeded by the renamer and its insistence to use different Uniques for different variables. (In contrast, the Core functions work on the output of optimizations, which may introduce shadowing.) Without shadowing, the problem studied by -Note [Closing over free variable kinds] in TyCoFVs cannot happen. +Note [Closing over free variable kinds] in GHC.Core.TyCo.FVs cannot happen. Why it is necessary: Wiping the bound set would be just plain wrong here. Consider @@ -1460,7 +1460,7 @@ We really don't want to think k1 and k2 are free here. (It's true that we'll never be able to fill in `hole`, but we don't want to go off the rails just because we have an insoluble coercion hole.) So: why is it wrong to wipe the bound variables here but right in Core? Because the final statement -in Note [Closing over free variable kinds] in TyCoFVs is wrong: not +in Note [Closing over free variable kinds] in GHC.Core.TyCo.FVs is wrong: not every variable is either free or bound. A variable can be a hole, too! The reasoning in that Note then breaks down. diff --git a/compiler/typecheck/TcMatches.hs b/compiler/typecheck/TcMatches.hs index 262e7ccf2c..e0304ec6fa 100644 --- a/compiler/typecheck/TcMatches.hs +++ b/compiler/typecheck/TcMatches.hs @@ -40,7 +40,7 @@ import TcOrigin import Name import TysWiredIn import Id -import TyCon +import GHC.Core.TyCon import TysPrim import TcEvidence import Outputable diff --git a/compiler/typecheck/TcOrigin.hs b/compiler/typecheck/TcOrigin.hs index 4137939135..37b4d9a8d9 100644 --- a/compiler/typecheck/TcOrigin.hs +++ b/compiler/typecheck/TcOrigin.hs @@ -34,11 +34,11 @@ import TcType import GHC.Hs import Id -import DataCon -import ConLike -import TyCon -import InstEnv -import PatSyn +import GHC.Core.DataCon +import GHC.Core.ConLike +import GHC.Core.TyCon +import GHC.Core.InstEnv +import GHC.Core.PatSyn import Module import Name diff --git a/compiler/typecheck/TcPat.hs b/compiler/typecheck/TcPat.hs index 9f298bfdad..855935caba 100644 --- a/compiler/typecheck/TcPat.hs +++ b/compiler/typecheck/TcPat.hs @@ -35,17 +35,17 @@ import RdrName import TcEnv import TcMType import TcValidity( arityErr ) -import TyCoPpr ( pprTyVars ) +import GHC.Core.TyCo.Ppr ( pprTyVars ) import TcType import TcUnify import TcHsType import TysWiredIn import TcEvidence import TcOrigin -import TyCon -import DataCon -import PatSyn -import ConLike +import GHC.Core.TyCon +import GHC.Core.DataCon +import GHC.Core.PatSyn +import GHC.Core.ConLike import PrelNames import BasicTypes hiding (SuccessFlag(..)) import GHC.Driver.Session @@ -455,7 +455,7 @@ tc_pat penv (TuplePat _ pats boxity) pat_ty thing_inside ; (coi, arg_tys) <- matchExpectedPatTy (matchExpectedTyConApp tc) penv pat_ty -- Unboxed tuples have RuntimeRep vars, which we discard: - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon ; let con_arg_tys = case boxity of Unboxed -> drop arity arg_tys Boxed -> arg_tys ; (pats', res) <- tc_lpats penv pats (map mkCheckExpType con_arg_tys) diff --git a/compiler/typecheck/TcPatSyn.hs b/compiler/typecheck/TcPatSyn.hs index d43461745b..a81ae283fd 100644 --- a/compiler/typecheck/TcPatSyn.hs +++ b/compiler/typecheck/TcPatSyn.hs @@ -20,7 +20,7 @@ import GhcPrelude import GHC.Hs import TcPat -import Type( tidyTyCoVarBinders, tidyTypes, tidyType ) +import GHC.Core.Type ( tidyTyCoVarBinders, tidyTypes, tidyType ) import TcRnMonad import TcSigs( emptyPragEnv, completeSigFromId ) import TcEnv @@ -29,7 +29,7 @@ import TcHsSyn import TysPrim import Name import SrcLoc -import PatSyn +import GHC.Core.PatSyn import NameSet import Panic import Outputable @@ -42,7 +42,7 @@ import TcBinds import BasicTypes import TcSimplify import TcUnify -import Predicate +import GHC.Core.Predicate import TysWiredIn import TcType import TcEvidence @@ -51,7 +51,7 @@ import BuildTyCl import VarSet import MkId import TcTyDecls -import ConLike +import GHC.Core.ConLike import FieldLabel import Bag import Util @@ -303,7 +303,7 @@ have type $bP :: forall a b. (a ~# Maybe b, Eq b) => [b] -> X a and that is bad because (a ~# Maybe b) is not a predicate type -(see Note [Types for coercions, predicates, and evidence] in TyCoRep +(see Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep and is not implicitly instantiated. So in mkProvEvidence we lift (a ~# b) to (a ~ b). Tiresome, and @@ -400,7 +400,7 @@ tcCheckPatSynDecl psb@PSB{ psb_id = lname@(L _ name), psb_args = details -- satisfy the substitution invariant. There's no need to -- add 'ex_tvs' as they are already in the domain of the -- substitution. - -- See also Note [The substitution invariant] in TyCoSubst. + -- See also Note [The substitution invariant] in GHC.Core.TyCo.Subst. ; prov_dicts <- mapM (emitWanted (ProvCtxtOrigin psb)) prov_theta' ; args' <- zipWithM (tc_arg subst) arg_names arg_tys ; return (ex_tvs', prov_dicts, args') } @@ -686,7 +686,7 @@ tcPatSynMatcher :: Located Name -> ([LHsExpr GhcTcId], [TcType]) -> TcType -> TcM ((Id, Bool), LHsBinds GhcTc) --- See Note [Matchers and builders for pattern synonyms] in PatSyn +-- See Note [Matchers and builders for pattern synonyms] in GHC.Core.PatSyn tcPatSynMatcher (L loc name) lpat (univ_tvs, req_theta, req_ev_binds, req_dicts) (ex_tvs, ex_tys, prov_theta, prov_dicts) @@ -812,7 +812,7 @@ mkPatSynBuilderId dir (L _ name) tcPatSynBuilderBind :: PatSynBind GhcRn GhcRn -> TcM (LHsBinds GhcTc) --- See Note [Matchers and builders for pattern synonyms] in PatSyn +-- See Note [Matchers and builders for pattern synonyms] in GHC.Core.PatSyn tcPatSynBuilderBind (PSB { psb_id = L loc name , psb_def = lpat , psb_dir = dir diff --git a/compiler/typecheck/TcPluginM.hs b/compiler/typecheck/TcPluginM.hs index 04aaf74816..36d35e049a 100644 --- a/compiler/typecheck/TcPluginM.hs +++ b/compiler/typecheck/TcPluginM.hs @@ -60,7 +60,7 @@ import qualified FamInst as TcM import qualified GHC.Iface.Env as IfaceEnv import qualified GHC.Driver.Finder as Finder -import FamInstEnv ( FamInstEnv ) +import GHC.Core.FamInstEnv ( FamInstEnv ) import TcRnMonad ( TcGblEnv, TcLclEnv, TcPluginM , unsafeTcPluginTcM, getEvBindsTcPluginM , liftIO, traceTc ) @@ -73,14 +73,14 @@ import Var ( EvVar ) import Module import Name -import TyCon -import DataCon -import Class +import GHC.Core.TyCon +import GHC.Core.DataCon +import GHC.Core.Class import GHC.Driver.Types import Outputable -import Type +import GHC.Core.Type import Id -import InstEnv +import GHC.Core.InstEnv import FastString import Unique diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs index 2423805f8e..8c7658c1d6 100644 --- a/compiler/typecheck/TcRnDriver.hs +++ b/compiler/typecheck/TcRnDriver.hs @@ -68,7 +68,7 @@ import GHC.Driver.Session import GHC.Hs import GHC.Iface.Syntax ( ShowSub(..), showToHeader ) import GHC.Iface.Type ( ShowForAllFlag(..) ) -import PatSyn( pprPatSynType ) +import GHC.Core.PatSyn( pprPatSynType ) import PrelNames import PrelInfo import RdrName @@ -83,9 +83,10 @@ import qualified BooleanFormula as BF import GHC.Core.Ppr.TyThing ( pprTyThingInContext ) import GHC.Core.FVs ( orphNamesOfFamInst ) import FamInst -import InstEnv -import FamInstEnv( FamInst, pprFamInst, famInstsRepTyCons - , famInstEnvElts, extendFamInstEnvList, normaliseType ) +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv + ( FamInst, pprFamInst, famInstsRepTyCons + , famInstEnvElts, extendFamInstEnvList, normaliseType ) import TcAnnotations import TcBinds import GHC.Iface.Make ( coAxiomToIfaceDecl ) @@ -116,17 +117,17 @@ import Name import NameEnv import NameSet import Avail -import TyCon +import GHC.Core.TyCon import SrcLoc import GHC.Driver.Types import ListSetOps import Outputable -import ConLike -import DataCon -import Type -import Class +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.Type +import GHC.Core.Class import BasicTypes hiding( SuccessFlag(..) ) -import CoAxiom +import GHC.Core.Coercion.Axiom import Annotations import Data.List ( sortBy, sort ) import Data.Ord diff --git a/compiler/typecheck/TcRnDriver.hs-boot b/compiler/typecheck/TcRnDriver.hs-boot index cdbdca50af..7cd65195be 100644 --- a/compiler/typecheck/TcRnDriver.hs-boot +++ b/compiler/typecheck/TcRnDriver.hs-boot @@ -1,7 +1,7 @@ module TcRnDriver where import GhcPrelude -import Type (TyThing) +import GHC.Core.Type(TyThing) import TcRnTypes (TcM) import Outputable (SDoc) import Name (Name) diff --git a/compiler/typecheck/TcRnExports.hs b/compiler/typecheck/TcRnExports.hs index 7fbf553afa..fea68a4054 100644 --- a/compiler/typecheck/TcRnExports.hs +++ b/compiler/typecheck/TcRnExports.hs @@ -26,13 +26,13 @@ import Name import NameEnv import NameSet import Avail -import TyCon +import GHC.Core.TyCon import SrcLoc import GHC.Driver.Types import Outputable -import ConLike -import DataCon -import PatSyn +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.PatSyn import Maybes import UniqSet import Util (capitalise) diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs index b1330be15d..b8761fcdf1 100644 --- a/compiler/typecheck/TcRnMonad.hs +++ b/compiler/typecheck/TcRnMonad.hs @@ -156,11 +156,11 @@ import GHC.Driver.Types import Module import RdrName import Name -import Type +import GHC.Core.Type import TcType -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import PrelNames import Id diff --git a/compiler/typecheck/TcRnTypes.hs b/compiler/typecheck/TcRnTypes.hs index 13f4e6fd89..1f33287bb8 100644 --- a/compiler/typecheck/TcRnTypes.hs +++ b/compiler/typecheck/TcRnTypes.hs @@ -88,17 +88,17 @@ import GhcPrelude import GHC.Hs import GHC.Driver.Types import TcEvidence -import Type -import TyCon ( TyCon, tyConKind ) -import PatSyn ( PatSyn ) +import GHC.Core.Type +import GHC.Core.TyCon ( TyCon, tyConKind ) +import GHC.Core.PatSyn ( PatSyn ) import Id ( idType, idName ) import FieldLabel ( FieldLabel ) import TcType import Constraint import TcOrigin import Annotations -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import {-# SOURCE #-} GHC.HsToCore.PmCheck.Types (Deltas) import IOEnv import RdrName diff --git a/compiler/typecheck/TcRules.hs b/compiler/typecheck/TcRules.hs index 76b1c651ad..3c3dadc49e 100644 --- a/compiler/typecheck/TcRules.hs +++ b/compiler/typecheck/TcRules.hs @@ -18,7 +18,7 @@ import TcRnTypes import TcRnMonad import TcSimplify import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import TcMType import TcType @@ -27,8 +27,8 @@ import TcExpr import TcEnv import TcUnify( buildImplicationFor ) import TcEvidence( mkTcCoVarCo ) -import Type -import TyCon( isTypeFamilyTyCon ) +import GHC.Core.Type +import GHC.Core.TyCon( isTypeFamilyTyCon ) import Id import Var( EvVar ) import VarSet diff --git a/compiler/typecheck/TcSMonad.hs b/compiler/typecheck/TcSMonad.hs index 727419faeb..3fd956f87a 100644 --- a/compiler/typecheck/TcSMonad.hs +++ b/compiler/typecheck/TcSMonad.hs @@ -132,9 +132,9 @@ import GhcPrelude import GHC.Driver.Types import qualified Inst as TcM -import InstEnv +import GHC.Core.InstEnv import FamInst -import FamInstEnv +import GHC.Core.FamInstEnv import qualified TcRnMonad as TcM import qualified TcMType as TcM @@ -144,14 +144,14 @@ import qualified TcEnv as TcM import ClsInst( InstanceWhat(..), safeOverlap, instanceReturnsDictCon ) import TcType import GHC.Driver.Session -import Type -import Coercion -import Unify +import GHC.Core.Type +import GHC.Core.Coercion +import GHC.Core.Unify import ErrUtils import TcEvidence -import Class -import TyCon +import GHC.Core.Class +import GHC.Core.TyCon import TcErrors ( solverDepthErrorTcS ) import Name @@ -168,7 +168,7 @@ import Util import TcRnTypes import TcOrigin import Constraint -import Predicate +import GHC.Core.Predicate import Unique import UniqFM diff --git a/compiler/typecheck/TcSigs.hs b/compiler/typecheck/TcSigs.hs index 95f4c846d2..b1ffd46978 100644 --- a/compiler/typecheck/TcSigs.hs +++ b/compiler/typecheck/TcSigs.hs @@ -39,7 +39,7 @@ import TcUnify( tcSkolemise, unifyType ) import Inst( topInstantiate ) import TcEnv( tcLookupId ) import TcEvidence( HsWrapper, (<.>) ) -import Type( mkTyVarBinders ) +import GHC.Core.Type ( mkTyVarBinders ) import GHC.Driver.Session import Var ( TyVar, tyVarKind ) diff --git a/compiler/typecheck/TcSimplify.hs b/compiler/typecheck/TcSimplify.hs index 476512bdd0..ea95a0b4ad 100644 --- a/compiler/typecheck/TcSimplify.hs +++ b/compiler/typecheck/TcSimplify.hs @@ -29,7 +29,7 @@ module TcSimplify( import GhcPrelude import Bag -import Class ( Class, classKey, classTyCon ) +import GHC.Core.Class ( Class, classKey, classTyCon ) import GHC.Driver.Session import Id ( idType, mkLocalId ) import Inst @@ -46,12 +46,12 @@ import TcMType as TcM import TcRnMonad as TcM import TcSMonad as TcS import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import TcType -import Type -import TysWiredIn ( liftedRepTy ) -import Unify ( tcMatchTyKi ) +import GHC.Core.Type +import TysWiredIn ( liftedRepTy ) +import GHC.Core.Unify ( tcMatchTyKi ) import Util import Var import VarSet diff --git a/compiler/typecheck/TcSplice.hs b/compiler/typecheck/TcSplice.hs index 97aff216f7..f0cc872d56 100644 --- a/compiler/typecheck/TcSplice.hs +++ b/compiler/typecheck/TcSplice.hs @@ -51,7 +51,7 @@ import THNames import TcUnify import TcEnv import TcOrigin -import Coercion( etaExpandCoAxBranch ) +import GHC.Core.Coercion( etaExpandCoAxBranch ) import FileCleanup ( newTempName, TempFileLifetime(..) ) import Control.Monad @@ -74,15 +74,15 @@ import GHC.Rename.Fixity ( lookupFixityRn_help ) import GHC.Rename.Types import TcHsSyn import TcSimplify -import Type +import GHC.Core.Type as Type import NameSet import TcMType import TcHsType import GHC.IfaceToCore -import TyCoRep +import GHC.Core.TyCo.Rep as TyCoRep import FamInst -import FamInstEnv -import InstEnv +import GHC.Core.FamInstEnv +import GHC.Core.InstEnv as InstEnv import Inst import NameEnv import PrelNames @@ -92,12 +92,12 @@ import GHC.Driver.Hooks import Var import Module import GHC.Iface.Load -import Class -import TyCon -import CoAxiom -import PatSyn -import ConLike -import DataCon +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom +import GHC.Core.PatSyn +import GHC.Core.ConLike +import GHC.Core.DataCon as DataCon import TcEvidence import Id import IdInfo @@ -1977,7 +1977,7 @@ If you're not careful, reifying these instances might yield this: We can fix this ambiguity by reifying the instances' explicit return kinds. We should only do this if necessary (see -Note [When does a tycon application need an explicit kind signature?] in Type), +Note [When does a tycon application need an explicit kind signature?] in GHC.Core.Type), but more importantly, we *only* do this if either of the following are true: 1. The data family instance has no constructors. @@ -2046,7 +2046,7 @@ reifyFamilyInstance is_poly_tvs (FamInst { fi_flavor = flavor DataFamilyInst rep_tc -> do { let -- eta-expand lhs types, because sometimes data/newtype -- instances are eta-reduced; See #9692 - -- See Note [Eta reduction for data families] in FamInstEnv + -- See Note [Eta reduction for data families] in GHC.Core.FamInstEnv (ee_tvs, ee_lhs, _) = etaExpandCoAxBranch branch fam' = reifyName fam dataCons = tyConDataCons rep_tc @@ -2175,7 +2175,7 @@ reify_tc_app tc tys r_tc | isUnboxedSumTyCon tc = TH.UnboxedSumT (arity `div` 2) | isUnboxedTupleTyCon tc = TH.UnboxedTupleT (arity `div` 2) | isPromotedTupleTyCon tc = TH.PromotedTupleT (arity `div` 2) - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon | isTupleTyCon tc = if isPromotedDataCon tc then TH.PromotedTupleT arity else TH.TupleT arity @@ -2192,7 +2192,7 @@ reify_tc_app tc tys | otherwise = TH.ConT (reifyName tc) -- See Note [When does a tycon application need an explicit kind - -- signature?] in TyCoRep + -- signature?] in GHC.Core.TyCo.Rep maybe_sig_t th_type | tyConAppNeedsKindSig False -- We don't reify types using visible kind applications, so diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs index 97c39b7176..d6f4148abb 100644 --- a/compiler/typecheck/TcTyClsDecls.hs +++ b/compiler/typecheck/TcTyClsDecls.hs @@ -47,16 +47,16 @@ import TysWiredIn ( unitTy, makeRecoveryTyCon ) import TcType import GHC.Rename.Env( lookupConstructorFields ) import FamInst -import FamInstEnv -import Coercion +import GHC.Core.FamInstEnv +import GHC.Core.Coercion import TcOrigin -import Type -import TyCoRep -- for checkValidRoles -import TyCoPpr( pprTyVars, pprWithExplicitKindsWhen ) -import Class -import CoAxiom -import TyCon -import DataCon +import GHC.Core.Type +import GHC.Core.TyCo.Rep -- for checkValidRoles +import GHC.Core.TyCo.Ppr( pprTyVars, pprWithExplicitKindsWhen ) +import GHC.Core.Class +import GHC.Core.Coercion.Axiom +import GHC.Core.TyCon +import GHC.Core.DataCon import Id import Var import VarEnv @@ -67,13 +67,13 @@ import NameSet import NameEnv import Outputable import Maybes -import Unify +import GHC.Core.Unify import Util import SrcLoc import ListSetOps import GHC.Driver.Session import Unique -import ConLike( ConLike(..) ) +import GHC.Core.ConLike( ConLike(..) ) import BasicTypes import qualified GHC.LanguageExtensions as LangExt @@ -841,7 +841,7 @@ generaliseTcTyCon (tc, scoped_prs, tc_res_kind) do { -- Step 1: Separate Specified from Required variables -- NB: spec_req_tvs = spec_tvs ++ req_tvs -- And req_tvs is 1-1 with tyConTyVars - -- See Note [Scoped tyvars in a TcTyCon] in TyCon + -- See Note [Scoped tyvars in a TcTyCon] in GHC.Core.TyCon ; let spec_req_tvs = map snd scoped_prs n_spec = length spec_req_tvs - tyConArity tc (spec_tvs, req_tvs) = splitAt n_spec spec_req_tvs @@ -931,7 +931,7 @@ promises about the ordering of some variables. These might swizzle around even between minor released. By forbidding visible type application, we ensure users aren't caught unawares. -Go read Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep. +Go read Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep. The question for this Note is this: given a TyClDecl, how are its quantified type variables classified? @@ -2638,7 +2638,7 @@ have After checking (F :: forall k. k) (with no visible patterns), we still need to instantiate the k. With data family instances, this problem can be even -more intricate, due to Note [Arity of data families] in FamInstEnv. See +more intricate, due to Note [Arity of data families] in GHC.Core.FamInstEnv. See indexed-types/should_compile/T12369 for an example. So, the kind-checker must return the new skolems and args (that is, Type @@ -2992,7 +2992,7 @@ tcConDecl rep_tycon tag_map tmpl_bndrs res_kind res_tmpl new_or_data ex_tvs = qkvs ++ user_qtvs -- For H98 datatypes, the user-written tyvar binders are precisely -- the universals followed by the existentials. - -- See Note [DataCon user type variable binders] in DataCon. + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon. user_tvbs = univ_tvbs ++ ex_tvbs buildOneDataCon (L _ name) = do { is_infix <- tcConIsInfixH98 name hs_args @@ -3066,7 +3066,7 @@ tcConDecl rep_tycon tag_map tmpl_bndrs _res_kind res_tmpl new_or_data -- Compute the user-written tyvar binders. These have the same -- tyvars as univ_tvs/ex_tvs, but perhaps in a different order. - -- See Note [DataCon user type variable binders] in DataCon. + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon. tkv_bndrs = mkTyVarBinders Inferred tkvs' user_tv_bndrs = mkTyVarBinders Specified user_tvs' all_user_bndrs = tkv_bndrs ++ user_tv_bndrs @@ -3234,7 +3234,7 @@ rejigConRes tmpl_bndrs res_tmpl dc_inferred_tvs dc_specified_tvs res_ty -- Existentials are the leftover type vars: [x,y] -- The user-written type variables are what is listed in the forall: -- [x, y, z] (all specified). We must rejig these as well. - -- See Note [DataCon user type variable binders] in DataCon. + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon. -- So we return ( [a,b,z], [x,y] -- , [], [x,y,z] -- , [a~(x,y),b~z], <arg-subst> ) @@ -3247,7 +3247,7 @@ rejigConRes tmpl_bndrs res_tmpl dc_inferred_tvs dc_specified_tvs res_ty -- gives us exactly what we need to rejig the user-written tyvars, -- since the dcUserTyVarBinders invariant guarantees that the -- substitution has *all* the tyvars in its domain. - -- See Note [DataCon user type variable binders] in DataCon. + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon. subst_user_tvs = map (getTyVar "rejigConRes" . substTyVar arg_subst) substed_inferred_tvs = subst_user_tvs dc_inferred_tvs substed_specified_tvs = subst_user_tvs dc_specified_tvs @@ -3803,7 +3803,7 @@ checkValidDataCon dflags existential_ok tc con ; zipWith3M_ check_bang (dataConSrcBangs con) (dataConImplBangs con) [1..] -- Check the dcUserTyVarBinders invariant - -- See Note [DataCon user type variable binders] in DataCon + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon -- checked here because we sometimes build invalid DataCons before -- erroring above here ; when debugIsOn $ diff --git a/compiler/typecheck/TcTyDecls.hs b/compiler/typecheck/TcTyDecls.hs index b9b51e11f7..aa716d8f47 100644 --- a/compiler/typecheck/TcTyDecls.hs +++ b/compiler/typecheck/TcTyDecls.hs @@ -36,18 +36,18 @@ import GhcPrelude import TcRnMonad import TcEnv import TcBinds( tcValBinds ) -import TyCoRep( Type(..), Coercion(..), MCoercion(..), UnivCoProvenance(..) ) +import GHC.Core.TyCo.Rep( Type(..), Coercion(..), MCoercion(..), UnivCoProvenance(..) ) import TcType -import Predicate +import GHC.Core.Predicate import TysWiredIn( unitTy ) import GHC.Core.Make( rEC_SEL_ERROR_ID ) import GHC.Hs -import Class -import Type +import GHC.Core.Class +import GHC.Core.Type import GHC.Driver.Types -import TyCon -import ConLike -import DataCon +import GHC.Core.TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon import Name import NameEnv import NameSet hiding (unitFV) @@ -56,7 +56,7 @@ import Id import IdInfo import VarEnv import VarSet -import Coercion ( ltRole ) +import GHC.Core.Coercion ( ltRole ) import BasicTypes import SrcLoc import Unique ( mkBuiltinUnique ) diff --git a/compiler/typecheck/TcType.hs b/compiler/typecheck/TcType.hs index 205951ddc8..8ea61cfa36 100644 --- a/compiler/typecheck/TcType.hs +++ b/compiler/typecheck/TcType.hs @@ -193,19 +193,19 @@ module TcType ( -- friends: import GhcPrelude -import TyCoRep -import TyCoSubst ( mkTvSubst, substTyWithCoVars ) -import TyCoFVs -import TyCoPpr -import Class +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Subst ( mkTvSubst, substTyWithCoVars ) +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr +import GHC.Core.Class import Var import ForeignCall import VarSet -import Coercion -import Type -import Predicate +import GHC.Core.Coercion +import GHC.Core.Type as Type +import GHC.Core.Predicate import GHC.Types.RepType -import TyCon +import GHC.Core.TyCon -- others: import GHC.Driver.Session @@ -508,7 +508,7 @@ data TcTyVarDetails -- how this level number is used Bool -- True <=> this skolem type variable can be overlapped -- when looking up instances - -- See Note [Binding when looking up instances] in InstEnv + -- See Note [Binding when looking up instances] in GHC.Core.InstEnv | RuntimeUnk -- Stands for an as-yet-unknown type in the GHCi -- interactive context @@ -518,7 +518,7 @@ data TcTyVarDetails , mtv_tclvl :: TcLevel } -- See Note [TcLevel and untouchable type variables] vanillaSkolemTv, superSkolemTv :: TcTyVarDetails --- See Note [Binding when looking up instances] in InstEnv +-- See Note [Binding when looking up instances] in GHC.Core.InstEnv vanillaSkolemTv = SkolemTv topTcLevel False -- Might be instantiated superSkolemTv = SkolemTv topTcLevel True -- Treat this as a completely distinct type -- The choice of level number here is a bit dodgy, but @@ -921,7 +921,7 @@ exactTyCoVarsOfType is used by the type checker to figure out exactly which type variables are mentioned in a type. It only matters occasionally -- see the calls to exactTyCoVarsOfType. -We place this function here in TcType, note in TyCoFVs, +We place this function here in TcType, not in GHC.Core.TyCo.FVs, because we want to "see" tcView (efficiency issue only). -} @@ -1494,7 +1494,7 @@ tcEqKind = tcEqType tcEqType :: HasDebugCallStack => TcType -> TcType -> Bool -- tcEqType is a proper implements the same Note [Non-trivial definitional --- equality] (in TyCoRep) as `eqType`, but Type.eqType believes (* == +-- equality] (in GHC.Core.TyCo.Rep) as `eqType`, but Type.eqType believes (* == -- Constraint), and that is NOT what we want in the type checker! tcEqType ty1 ty2 = tc_eq_type False False ki1 ki2 @@ -1556,7 +1556,7 @@ tc_eq_type keep_syns vis_only orig_ty1 orig_ty2 go env ty (FunTy _ arg res) = eqFunTy env arg res ty go env (FunTy _ arg res) ty = eqFunTy env arg res ty - -- See Note [Equality on AppTys] in Type + -- See Note [Equality on AppTys] in GHC.Core.Type go env (AppTy s1 t1) ty2 | Just (s2, t2) <- tcRepSplitAppTy_maybe ty2 = go env s1 s2 && go env t1 t2 @@ -1923,7 +1923,7 @@ Note [Lift equality constraints when quantifying] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We can't quantify over a constraint (t1 ~# t2) because that isn't a predicate type; see Note [Types for coercions, predicates, and evidence] -in TyCoRep. +in GHC.Core.TyCo.Rep. So we have to 'lift' it to (t1 ~ t2). Similarly (~R#) must be lifted to Coercible. diff --git a/compiler/typecheck/TcTypeNats.hs b/compiler/typecheck/TcTypeNats.hs index 6e5eb94d72..7fdd9d9028 100644 --- a/compiler/typecheck/TcTypeNats.hs +++ b/compiler/typecheck/TcTypeNats.hs @@ -23,14 +23,14 @@ module TcTypeNats import GhcPrelude -import Type +import GHC.Core.Type import Pair -import TcType ( TcType, tcEqType ) -import TyCon ( TyCon, FamTyConFlav(..), mkFamilyTyCon - , Injectivity(..) ) -import Coercion ( Role(..) ) +import TcType ( TcType, tcEqType ) +import GHC.Core.TyCon ( TyCon, FamTyConFlav(..), mkFamilyTyCon + , Injectivity(..) ) +import GHC.Core.Coercion ( Role(..) ) import Constraint ( Xi ) -import CoAxiom ( CoAxiomRule(..), BuiltInSynFamily(..), TypeEqn ) +import GHC.Core.Coercion.Axiom ( CoAxiomRule(..), BuiltInSynFamily(..), TypeEqn ) import Name ( Name, BuiltInSyntax(..) ) import TysWiredIn import TysPrim ( mkTemplateAnonTyConBinders ) diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs index 19d695f6d1..3f77146367 100644 --- a/compiler/typecheck/TcTypeable.hs +++ b/compiler/typecheck/TcTypeable.hs @@ -16,7 +16,7 @@ import GhcPrelude import BasicTypes ( Boxity(..), neverInlinePragma, SourceText(..) ) import GHC.Iface.Env( newGlobalBinder ) -import TyCoRep( Type(..), TyLit(..) ) +import GHC.Core.TyCo.Rep( Type(..), TyLit(..) ) import TcEnv import TcEvidence ( mkWpTyApps ) import TcRnMonad @@ -29,9 +29,9 @@ import TysWiredIn ( tupleTyCon, sumTyCon, runtimeRepTyCon , nilDataCon, consDataCon ) import Name import Id -import Type -import TyCon -import DataCon +import GHC.Core.Type +import GHC.Core.TyCon +import GHC.Core.DataCon import Module import GHC.Hs import GHC.Driver.Session @@ -76,7 +76,7 @@ The overall plan is this: recipe for computing the kind of an instantiation of the tycon (see Note [Representing TyCon kinds: KindRep] later in this file for details). - We define (in TyCon) + We define (in GHC.Core.TyCon) type TyConRepName = Name diff --git a/compiler/typecheck/TcUnify.hs b/compiler/typecheck/TcUnify.hs index 4c1b18d89c..cb3865122b 100644 --- a/compiler/typecheck/TcUnify.hs +++ b/compiler/typecheck/TcUnify.hs @@ -44,20 +44,20 @@ module TcUnify ( import GhcPrelude import GHC.Hs -import TyCoRep -import TyCoPpr( debugPprType ) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr( debugPprType ) import TcMType import TcRnMonad import TcType -import Type -import Coercion +import GHC.Core.Type +import GHC.Core.Coercion import TcEvidence import Constraint -import Predicate +import GHC.Core.Predicate import TcOrigin import Name( isSystemName ) import Inst -import TyCon +import GHC.Core.TyCon import TysWiredIn import TysPrim( tYPE ) import Var diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs index 385dd074a9..3f55d72c5c 100644 --- a/compiler/typecheck/TcValidity.hs +++ b/compiler/typecheck/TcValidity.hs @@ -30,19 +30,19 @@ import Maybes import TcUnify ( tcSubType_NC ) import TcSimplify ( simplifyAmbiguityCheck ) import ClsInst ( matchGlobalInst, ClsInstResult(..), InstanceWhat(..), AssocInstInfo(..) ) -import TyCoFVs -import TyCoRep -import TyCoPpr +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Ppr import TcType hiding ( sizeType, sizeTypes ) import TysWiredIn ( heqTyConName, eqTyConName, coercibleTyConName ) import PrelNames -import Type -import Unify ( tcMatchTyX_BM, BindFlag(..) ) -import Coercion -import CoAxiom -import Class -import TyCon -import Predicate +import GHC.Core.Type +import GHC.Core.Unify ( tcMatchTyX_BM, BindFlag(..) ) +import GHC.Core.Coercion +import GHC.Core.Coercion.Axiom +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.Predicate import TcOrigin -- others: @@ -52,8 +52,8 @@ import GHC.Hs -- HsType import TcRnMonad -- TcType, amongst others import TcEnv ( tcInitTidyEnv, tcInitOpenTidyEnv ) import FunDeps -import FamInstEnv ( isDominatedBy, injectiveBranches, - InjectivityCheckResult(..) ) +import GHC.Core.FamInstEnv + ( isDominatedBy, injectiveBranches, InjectivityCheckResult(..) ) import FamInst import Name import VarEnv @@ -891,7 +891,7 @@ checkEscapingKind env tvbs theta tau = case occCheckExpand (binderVars tvbs) phi_kind of -- Ensure that none of the tvs occur in the kind of the forall -- /after/ expanding type synonyms. - -- See Note [Phantom type variables in kinds] in Type + -- See Note [Phantom type variables in kinds] in GHC.Core.Type Nothing -> failWithTcM $ forAllEscapeErr env tvbs theta tau tau_kind Just _ -> pure () where @@ -943,7 +943,7 @@ checkConstraintsOK ve theta ty | allConstraintsAllowed (ve_ctxt ve) = return () | otherwise = -- We are in a kind, where we allow only equality predicates - -- See Note [Constraints in kinds] in TyCoRep, and #16263 + -- See Note [Constraints in kinds] in GHC.Core.TyCo.Rep, and #16263 checkTcM (all isEqPred theta) $ constraintTyErr (ve_tidy_env ve) ty @@ -2031,7 +2031,7 @@ checkValidCoAxiom ax@(CoAxiom { co_ax_tc = fam_tc, co_ax_branches = branches }) -- Injectivity check: check whether a new (CoAxBranch) can extend -- already checked equations without violating injectivity -- annotation supplied by the user. - -- See Note [Verifying injectivity annotation] in FamInstEnv + -- See Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv check_injectivity prev_branches cur_branch | Injective inj <- injectivity = do { dflags <- getDynFlags @@ -2046,7 +2046,7 @@ checkValidCoAxiom ax@(CoAxiom { co_ax_tc = fam_tc, co_ax_branches = branches }) gather_conflicts inj prev_branches cur_branch (acc, n) branch -- n is 0-based index of branch in prev_branches = case injectiveBranches inj cur_branch branch of - -- Case 1B2 in Note [Verifying injectivity annotation] in FamInstEnv + -- Case 1B2 in Note [Verifying injectivity annotation] in GHC.Core.FamInstEnv InjectivityUnified ax1 ax2 | ax1 `isDominatedBy` (replace_br prev_branches n ax2) -> (acc, n + 1) @@ -2669,7 +2669,7 @@ To solve this problem in a robust way, we do the following: Note that we only perform this check for type families, and not for data families. This is because it is perfectly acceptable to oversaturate data -family instance equations: see Note [Arity of data families] in FamInstEnv. +family instance equations: see Note [Arity of data families] in GHC.Core.FamInstEnv. ************************************************************************ * * |