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 | |
parent | 818b3c38e7548f4720815f76969238d82c9650f7 (diff) | |
download | haskell-18a346a4b5a02b8c62e8eedb91b35c2d8e754b96.tar.gz |
Modules: Core (#13009)
Update submodule: haddock
Diffstat (limited to 'compiler')
218 files changed, 1197 insertions, 1183 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs index 11c1ce8521..13beb050af 100644 --- a/compiler/GHC.hs +++ b/compiler/GHC.hs @@ -311,27 +311,28 @@ import GHC.Driver.Monad import TcRnMonad ( finalSafeMode, fixSafeInstances, initIfaceTcRn ) import GHC.Iface.Load ( loadSysInterface ) import TcRnTypes -import Predicate +import GHC.Core.Predicate import GHC.Driver.Packages import NameSet import RdrName import GHC.Hs -import Type hiding( typeKind ) +import GHC.Core.Type hiding( typeKind ) import TcType import Id import TysPrim ( alphaTyVars ) -import TyCon -import TyCoPpr ( pprForAll ) -import Class -import DataCon +import GHC.Core.TyCon +import GHC.Core.TyCo.Ppr ( pprForAll ) +import GHC.Core.Class +import GHC.Core.DataCon +import GHC.Core.FVs ( orphNamesOfFamInst ) +import GHC.Core.FamInstEnv ( FamInst, famInstEnvElts ) +import GHC.Core.InstEnv import Name hiding ( varName ) import Avail -import InstEnv -import FamInstEnv ( FamInst ) import SrcLoc import GHC.Core import GHC.Iface.Tidy -import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename ) +import GHC.Driver.Phases ( Phase(..), isHaskellSrcFilename ) import GHC.Driver.Finder import GHC.Driver.Types import GHC.Driver.CmdLine @@ -356,8 +357,6 @@ import Lexer import ApiAnnotation import qualified GHC.LanguageExtensions as LangExt import NameEnv -import GHC.Core.FVs ( orphNamesOfFamInst ) -import FamInstEnv ( famInstEnvElts ) import TcRnDriver import Inst import FamInst diff --git a/compiler/GHC/ByteCode/Asm.hs b/compiler/GHC/ByteCode/Asm.hs index 79b0bc2766..c781a3a6d1 100644 --- a/compiler/GHC/ByteCode/Asm.hs +++ b/compiler/GHC/ByteCode/Asm.hs @@ -27,7 +27,7 @@ import GHC.Driver.Types import Name import NameSet import Literal -import TyCon +import GHC.Core.TyCon import FastString import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Runtime.Heap.Layout diff --git a/compiler/GHC/ByteCode/InfoTable.hs b/compiler/GHC/ByteCode/InfoTable.hs index 80a259d94d..1c2a89b02b 100644 --- a/compiler/GHC/ByteCode/InfoTable.hs +++ b/compiler/GHC/ByteCode/InfoTable.hs @@ -17,8 +17,8 @@ import GHC.Driver.Session import GHC.Driver.Types import Name ( Name, getName ) import NameEnv -import DataCon ( DataCon, dataConRepArgTys, dataConIdentity ) -import TyCon ( TyCon, tyConFamilySize, isDataTyCon, tyConDataCons ) +import GHC.Core.DataCon ( DataCon, dataConRepArgTys, dataConIdentity ) +import GHC.Core.TyCon ( TyCon, tyConFamilySize, isDataTyCon, tyConDataCons ) import GHC.Types.RepType import GHC.StgToCmm.Layout ( mkVirtConstrSizes ) import GHC.StgToCmm.Closure ( tagForCon, NonVoid (..) ) diff --git a/compiler/GHC/ByteCode/Instr.hs b/compiler/GHC/ByteCode/Instr.hs index bff6bb5df0..8643752e2b 100644 --- a/compiler/GHC/ByteCode/Instr.hs +++ b/compiler/GHC/ByteCode/Instr.hs @@ -25,7 +25,7 @@ import Unique import Id import GHC.Core import Literal -import DataCon +import GHC.Core.DataCon import VarSet import PrimOp import GHC.Runtime.Heap.Layout diff --git a/compiler/GHC/ByteCode/Types.hs b/compiler/GHC/ByteCode/Types.hs index ce80c53279..491c4f99f9 100644 --- a/compiler/GHC/ByteCode/Types.hs +++ b/compiler/GHC/ByteCode/Types.hs @@ -22,7 +22,7 @@ import NameEnv import Outputable import PrimOp import SizedSeq -import Type +import GHC.Core.Type import SrcLoc import GHCi.BreakArray import GHCi.RemoteTypes diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs index 5a34ae45e2..53a1f095f8 100644 --- a/compiler/GHC/Cmm/Utils.hs +++ b/compiler/GHC/Cmm/Utils.hs @@ -72,7 +72,7 @@ module GHC.Cmm.Utils( import GhcPrelude -import TyCon ( PrimRep(..), PrimElemRep(..) ) +import GHC.Core.TyCon ( PrimRep(..), PrimElemRep(..) ) import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 ) import GHC.Runtime.Heap.Layout diff --git a/compiler/GHC/Core.hs b/compiler/GHC/Core.hs index 7fe26e0f39..b4af2b2eea 100644 --- a/compiler/GHC/Core.hs +++ b/compiler/GHC/Core.hs @@ -104,13 +104,13 @@ import GhcPrelude import CostCentre import VarEnv( InScopeSet ) import Var -import Type -import Coercion +import GHC.Core.Type +import GHC.Core.Coercion import Name import NameSet import NameEnv( NameEnv, emptyNameEnv ) import Literal -import DataCon +import GHC.Core.DataCon import Module import BasicTypes import GHC.Driver.Session diff --git a/compiler/GHC/Core/Arity.hs b/compiler/GHC/Core/Arity.hs index 73122bef30..df16701396 100644 --- a/compiler/GHC/Core/Arity.hs +++ b/compiler/GHC/Core/Arity.hs @@ -31,10 +31,10 @@ import Demand import Var import VarEnv import Id -import Type -import TyCon ( initRecTc, checkRecTc ) -import Predicate ( isDictTy ) -import Coercion +import GHC.Core.Type as Type +import GHC.Core.TyCon ( initRecTc, checkRecTc ) +import GHC.Core.Predicate ( isDictTy ) +import GHC.Core.Coercion as Coercion import BasicTypes import Unique import GHC.Driver.Session ( DynFlags, GeneralFlag(..), gopt ) @@ -130,7 +130,7 @@ typeArity ty | Just (tc,tys) <- splitTyConApp_maybe ty , Just (ty', _) <- instNewTyCon_maybe tc tys , Just rec_nts' <- checkRecTc rec_nts tc -- See Note [Expanding newtypes] - -- in TyCon + -- in GHC.Core.TyCon -- , not (isClassTyCon tc) -- Do not eta-expand through newtype classes -- -- See Note [Newtype classes and eta expansion] -- (no longer required) diff --git a/compiler/types/Class.hs b/compiler/GHC/Core/Class.hs index 0f0e688f5b..5020ce6617 100644 --- a/compiler/types/Class.hs +++ b/compiler/GHC/Core/Class.hs @@ -5,7 +5,7 @@ {-# LANGUAGE CPP #-} -module Class ( +module GHC.Core.Class ( Class, ClassOpItem, ClassATItem(..), @@ -25,9 +25,9 @@ module Class ( import GhcPrelude -import {-# SOURCE #-} TyCon ( TyCon ) -import {-# SOURCE #-} TyCoRep ( Type, PredType ) -import {-# SOURCE #-} TyCoPpr ( pprType ) +import {-# SOURCE #-} GHC.Core.TyCon ( TyCon ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, PredType ) +import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType ) import Var import Name import BasicTypes @@ -53,7 +53,7 @@ data Class = Class { classTyCon :: TyCon, -- The data type constructor for -- dictionaries of this class - -- See Note [ATyCon for classes] in TyCoRep + -- See Note [ATyCon for classes] in GHC.Core.TyCo.Rep className :: Name, -- Just the cached name of the TyCon classKey :: Unique, -- Cached unique of TyCon diff --git a/compiler/types/Coercion.hs b/compiler/GHC/Core/Coercion.hs index 0a2c686f8a..3e59a6ef85 100644 --- a/compiler/types/Coercion.hs +++ b/compiler/GHC/Core/Coercion.hs @@ -9,7 +9,7 @@ -- as used in System FC. See 'GHC.Core.Expr' for -- more on System FC and how coercions fit into it. -- -module Coercion ( +module GHC.Core.Coercion ( -- * Main data type Coercion, CoercionN, CoercionR, CoercionP, MCoercion(..), MCoercionR, UnivCoProvenance, CoercionHole(..), coHoleCoVar, setCoHoleCoVar, @@ -121,14 +121,14 @@ import {-# SOURCE #-} GHC.CoreToIface (toIfaceTyCon, tidyToIfaceTcArgs) import GhcPrelude import GHC.Iface.Type -import TyCoRep -import TyCoFVs -import TyCoPpr -import TyCoSubst -import TyCoTidy -import Type -import TyCon -import CoAxiom +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr +import GHC.Core.TyCo.Subst +import GHC.Core.TyCo.Tidy +import GHC.Core.Type +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom import Var import VarEnv import VarSet @@ -155,7 +155,7 @@ import Data.Char( isDigit ) -- The coercion arguments always *precisely* saturate -- arity of (that branch of) the CoAxiom. If there are -- any left over, we use AppCo. See - -- See [Coercion axioms applied to coercions] in TyCoRep + -- See [Coercion axioms applied to coercions] in GHC.Core.TyCo.Rep \subsection{Coercion variables} %* * @@ -185,7 +185,7 @@ Defined here to avoid module loops. CoAxiom is loaded very early on. etaExpandCoAxBranch :: CoAxBranch -> ([TyVar], [Type], Type) -- Return the (tvs,lhs,rhs) after eta-expanding, -- to the way in which the axiom was originally written --- See Note [Eta reduction for data families] in CoAxiom +-- See Note [Eta reduction for data families] in GHC.Core.Coercion.Axiom etaExpandCoAxBranch (CoAxBranch { cab_tvs = tvs , cab_eta_tvs = eta_tvs , cab_lhs = lhs @@ -241,7 +241,7 @@ ppr_co_ax_branch ppr_rhs fam_tc branch -- Eta-expand LHS and RHS types, because sometimes data family -- instances are eta-reduced. - -- See Note [Eta reduction for data families] in FamInstEnv. + -- See Note [Eta reduction for data families] in GHC.Core.FamInstEnv. (ee_tvs, ee_lhs, ee_rhs) = etaExpandCoAxBranch branch pp_lhs = pprIfaceTypeApp topPrec (toIfaceTyCon fam_tc) @@ -330,7 +330,7 @@ Suppose we have this: (f |> co) t1 .. tn Then we want to push the coercion into the arguments, so as to make progress. For example of why you might want to do so, see Note -[Respecting definitional equality] in TyCoRep. +[Respecting definitional equality] in GHC.Core.TyCo.Rep. This is done by decomposePiCos. Specifically, if decomposePiCos co [t1,..,tn] = ([co1,...,cok], cor) @@ -732,7 +732,7 @@ mkAppCo (TyConAppCo r tc args) arg mkAppCo co arg = AppCo co arg -- Note, mkAppCo is careful to maintain invariants regarding -- where Refl constructors appear; see the comments in the definition --- of Coercion and the Note [Refl invariant] in TyCoRep. +-- of Coercion and the Note [Refl invariant] in GHC.Core.TyCo.Rep. -- | Applies multiple 'Coercion's to another 'Coercion', from left to right. -- See also 'mkAppCo'. @@ -743,8 +743,8 @@ mkAppCos co1 cos = foldl' mkAppCo co1 cos {- Note [Unused coercion variable in ForAllCo] -See Note [Unused coercion variable in ForAllTy] in TyCoRep for the motivation for -checking coercion variable in types. +See Note [Unused coercion variable in ForAllTy] in GHC.Core.TyCo.Rep for the +motivation for checking coercion variable in types. To lift the design choice to (ForAllCo cv kind_co body_co), we have two options: (1) In mkForAllCo, we check whether cv is a coercion variable @@ -1367,7 +1367,7 @@ promoteCoercion co = case co of ForAllCo _ _ _ -> ASSERT( False ) mkNomReflCo liftedTypeKind - -- See Note [Weird typing rule for ForAllTy] in Type + -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type FunCo _ _ _ -> ASSERT( False ) @@ -1416,7 +1416,7 @@ promoteCoercion co = case co of | otherwise -> ASSERT( False) mkNomReflCo liftedTypeKind - -- See Note [Weird typing rule for ForAllTy] in Type + -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type KindCo _ -> ASSERT( False ) @@ -1486,7 +1486,7 @@ castCoercionKindI g h1 h2 = mkCoherenceRightCo r t2 h2 (mkCoherenceLeftCo r t1 h1 g) where (Pair t1 t2, r) = coercionKindRole g --- See note [Newtype coercions] in TyCon +-- See note [Newtype coercions] in GHC.Core.TyCon mkPiCos :: Role -> [Var] -> Coercion -> Coercion mkPiCos r vs co = foldr (mkPiCo r) co vs @@ -1743,8 +1743,8 @@ This follows the lifting context extension definition in the data LiftingContext = LC TCvSubst LiftCoEnv -- in optCoercion, we need to lift when optimizing InstCo. - -- See Note [Optimising InstCo] in OptCoercion - -- We thus propagate the substitution from OptCoercion here. + -- See Note [Optimising InstCo] in GHC.Core.Coercion.Opt + -- We thus propagate the substitution from GHC.Core.Coercion.Opt here. instance Outputable LiftingContext where ppr (LC _ env) = hang (text "LiftingContext:") 2 (ppr env) @@ -1912,7 +1912,7 @@ Note [liftCoSubstTyVar] This function can fail if a coercion in the environment is of too low a role. liftCoSubstTyVar is called from two places: in liftCoSubst (naturally), and -also in matchAxiom in OptCoercion. From liftCoSubst, the so-called lifting +also in matchAxiom in GHC.Core.Coercion.Opt. From liftCoSubst, the so-called lifting lemma guarantees that the roles work out. If we fail in this case, we really should panic -- something is deeply wrong. But, in matchAxiom, failing is fine. matchAxiom is trying to find a set of coercions @@ -2423,7 +2423,8 @@ mkReprPrimEqPred ty1 ty2 -- | Assuming that two types are the same, ignoring coercions, find -- a nominal coercion between the types. This is useful when optimizing -- transitivity over coercion applications, where splitting two --- AppCos might yield different kinds. See Note [EtaAppCo] in OptCoercion. +-- AppCos might yield different kinds. See Note [EtaAppCo] in +-- GHC.Core.Coercion.Opt. buildCoercion :: Type -> Type -> CoercionN buildCoercion orig_ty1 orig_ty2 = go orig_ty1 orig_ty2 where @@ -2792,7 +2793,7 @@ is `k -> Any @a`, and thus the third argument of `x :: k` is well-kinded. -} --- This is shared between the flattener and the normaliser in FamInstEnv. +-- This is shared between the flattener and the normaliser in GHC.Core.FamInstEnv. -- See Note [simplifyArgsWorker] {-# INLINE simplifyArgsWorker #-} simplifyArgsWorker :: [TyCoBinder] -> Kind diff --git a/compiler/types/Coercion.hs-boot b/compiler/GHC/Core/Coercion.hs-boot index 6c7cfb5e68..8354cf1ad4 100644 --- a/compiler/types/Coercion.hs-boot +++ b/compiler/GHC/Core/Coercion.hs-boot @@ -1,14 +1,14 @@ {-# LANGUAGE FlexibleContexts #-} -module Coercion where +module GHC.Core.Coercion where import GhcPrelude -import {-# SOURCE #-} TyCoRep -import {-# SOURCE #-} TyCon +import {-# SOURCE #-} GHC.Core.TyCo.Rep +import {-# SOURCE #-} GHC.Core.TyCon import BasicTypes ( LeftOrRight ) -import CoAxiom +import GHC.Core.Coercion.Axiom import Var import Pair import Util diff --git a/compiler/types/CoAxiom.hs b/compiler/GHC/Core/Coercion/Axiom.hs index 49fc5e07a5..c6861d8590 100644 --- a/compiler/types/CoAxiom.hs +++ b/compiler/GHC/Core/Coercion/Axiom.hs @@ -6,7 +6,7 @@ -- | Module for coercion axioms, used to represent type family instances -- and newtypes -module CoAxiom ( +module GHC.Core.Coercion.Axiom ( BranchFlag, Branched, Unbranched, BranchIndex, Branches(..), manyBranches, unbranched, fromBranches, numBranches, @@ -31,9 +31,9 @@ module CoAxiom ( import GhcPrelude -import {-# SOURCE #-} TyCoRep ( Type ) -import {-# SOURCE #-} TyCoPpr ( pprType ) -import {-# SOURCE #-} TyCon ( TyCon ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type ) +import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType ) +import {-# SOURCE #-} GHC.Core.TyCon ( TyCon ) import Outputable import FastString import Name @@ -87,7 +87,7 @@ can unify with the supplied arguments. After all, it is possible that some of the type arguments are lambda-bound type variables whose instantiation may cause an earlier match among the branches. We wish to prohibit this behavior, so the type checker rules out the choice of a branch where a previous branch -can unify. See also [Apartness] in FamInstEnv.hs. +can unify. See also [Apartness] in GHC.Core.FamInstEnv. For example, the following is malformed, where 'a' is a lambda-bound type variable: @@ -306,7 +306,7 @@ isImplicitCoAxiom = co_ax_implicit coAxBranchIncomps :: CoAxBranch -> [CoAxBranch] coAxBranchIncomps = cab_incomps --- See Note [Compatibility checking] in FamInstEnv +-- See Note [Compatibility checking] in GHC.Core.FamInstEnv placeHolderIncomps :: [CoAxBranch] placeHolderIncomps = panic "placeHolderIncomps" @@ -431,7 +431,7 @@ looked like (See #9692, #14179, and #15845 for examples of what can go wrong if we don't eta-expand when showing things to the user.) -(See also Note [Newtype eta] in TyCon. This is notionally separate +(See also Note [Newtype eta] in GHC.Core.TyCon. This is notionally separate and deals with the axiom connecting a newtype with its representation type; but it too is eta-reduced.) -} @@ -473,8 +473,8 @@ instance Outputable CoAxBranch where Roles are defined here to avoid circular dependencies. -} --- See Note [Roles] in Coercion --- defined here to avoid cyclic dependency with Coercion +-- See Note [Roles] in GHC.Core.Coercion +-- defined here to avoid cyclic dependency with GHC.Core.Coercion -- -- Order of constructors matters: the Ord instance coincides with the *super*typing -- relation on roles. diff --git a/compiler/types/OptCoercion.hs b/compiler/GHC/Core/Coercion/Opt.hs index 9819e210ab..685d3a278c 100644 --- a/compiler/types/OptCoercion.hs +++ b/compiler/GHC/Core/Coercion/Opt.hs @@ -2,29 +2,29 @@ {-# LANGUAGE CPP #-} -module OptCoercion ( optCoercion, checkAxInstCo ) where +module GHC.Core.Coercion.Opt ( optCoercion, checkAxInstCo ) where #include "HsVersions.h" import GhcPrelude import GHC.Driver.Session -import TyCoRep -import TyCoSubst -import Coercion -import Type hiding( substTyVarBndr, substTy ) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Subst +import GHC.Core.Coercion +import GHC.Core.Type as Type hiding( substTyVarBndr, substTy ) import TcType ( exactTyCoVarsOfType ) -import TyCon -import CoAxiom +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom import VarSet import VarEnv import Outputable -import FamInstEnv ( flattenTys ) +import GHC.Core.FamInstEnv ( flattenTys ) import Pair import ListSetOps ( getNth ) import Util -import Unify -import InstEnv +import GHC.Core.Unify +import GHC.Core.InstEnv import Control.Monad ( zipWithM ) {- @@ -75,7 +75,7 @@ If we substitute the *type* tv for the *coercion* (g2 ; t2 ~ t2 |> sym h) in g, we'll get this result exactly. This is bizarre, though, because we're substituting a type variable with a coercion. However, -this operation already exists: it's called *lifting*, and defined in Coercion. +this operation already exists: it's called *lifting*, and defined in GHC.Core.Coercion. We just need to enhance the lifting operation to be able to deal with an ambient substitution, which is why a LiftingContext stores a TCvSubst. @@ -462,7 +462,7 @@ If we have (c :: t~t) we can optimise it to Refl. That increases the chances of floating the Refl upwards; e.g. Maybe c --> Refl (Maybe t) We do so here in optCoercion, not in mkCoVarCo; see Note [mkCoVarCo] -in Coercion. +in GHC.Core.Coercion. -} ------------- @@ -930,7 +930,7 @@ First, convince yourself of the following: (a |> (h -> <Type>)) (b |> h) `eqType` a b -That last fact is due to Note [Non-trivial definitional equality] in TyCoRep, +That last fact is due to Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep, where we ignore coercions in types as long as two types' kinds are the same. In our case, we meet this last condition, because @@ -965,7 +965,7 @@ The problem described here was first found in dependent/should_compile/dynamic-p -- Returns the conflicting branch, if it exists -- See Note [Conflict checking with AxiomInstCo] checkAxInstCo :: Coercion -> Maybe CoAxBranch --- defined here to avoid dependencies in Coercion +-- defined here to avoid dependencies in GHC.Core.Coercion -- If you edit this function, you may need to update the GHC formalism -- See Note [GHC Formalism] in GHC.Core.Lint checkAxInstCo (AxiomInstCo ax ind cos) @@ -986,7 +986,7 @@ checkAxInstCo (AxiomInstCo ax ind cos) check_no_conflict :: [Type] -> [CoAxBranch] -> Maybe CoAxBranch check_no_conflict _ [] = Nothing check_no_conflict flat (b@CoAxBranch { cab_lhs = lhs_incomp } : rest) - -- See Note [Apartness] in FamInstEnv + -- See Note [Apartness] in GHC.Core.FamInstEnv | SurelyApart <- tcUnifyTysFG instanceBindFun flat lhs_incomp = check_no_conflict flat rest | otherwise @@ -1162,7 +1162,7 @@ etaTyConAppCo_maybe tc co , Just (tc1, tys1) <- splitTyConApp_maybe ty1 , Just (tc2, tys2) <- splitTyConApp_maybe ty2 , tc1 == tc2 - , isInjectiveTyCon tc r -- See Note [NthCo and newtypes] in TyCoRep + , isInjectiveTyCon tc r -- See Note [NthCo and newtypes] in GHC.Core.TyCo.Rep , let n = length tys1 , tys2 `lengthIs` n -- This can fail in an erroneous program -- E.g. T a ~# T a b diff --git a/compiler/basicTypes/ConLike.hs b/compiler/GHC/Core/ConLike.hs index a9d7548b8a..14e859acd6 100644 --- a/compiler/basicTypes/ConLike.hs +++ b/compiler/GHC/Core/ConLike.hs @@ -7,7 +7,7 @@ {-# LANGUAGE CPP #-} -module ConLike ( +module GHC.Core.ConLike ( ConLike(..) , conLikeArity , conLikeFieldLabels @@ -28,16 +28,16 @@ module ConLike ( import GhcPrelude -import DataCon -import PatSyn +import GHC.Core.DataCon +import GHC.Core.PatSyn import Outputable import Unique import Util import Name import BasicTypes -import TyCoRep (Type, ThetaType) +import GHC.Core.TyCo.Rep (Type, ThetaType) import Var -import Type (mkTyConApp) +import GHC.Core.Type(mkTyConApp) import qualified Data.Data as Data @@ -167,7 +167,7 @@ conLikeResTy (PatSynCon ps) tys = patSynInstResTy ps tys conLikeFullSig :: ConLike -> ([TyVar], [TyCoVar], [EqSpec] -- Why tyvars for universal but tycovars for existential? - -- See Note [Existential coercion variables] in DataCon + -- See Note [Existential coercion variables] in GHC.Core.DataCon , ThetaType, ThetaType, [Type], Type) conLikeFullSig (RealDataCon con) = let (univ_tvs, ex_tvs, eq_spec, theta, arg_tys, res_ty) = dataConFullSig con diff --git a/compiler/GHC/Core/ConLike.hs-boot b/compiler/GHC/Core/ConLike.hs-boot new file mode 100644 index 0000000000..8b007a2e0d --- /dev/null +++ b/compiler/GHC/Core/ConLike.hs-boot @@ -0,0 +1,9 @@ +module GHC.Core.ConLike where +import {-# SOURCE #-} GHC.Core.DataCon (DataCon) +import {-# SOURCE #-} GHC.Core.PatSyn (PatSyn) +import Name ( Name ) + +data ConLike = RealDataCon DataCon + | PatSynCon PatSyn + +conLikeName :: ConLike -> Name diff --git a/compiler/basicTypes/DataCon.hs b/compiler/GHC/Core/DataCon.hs index 7db26f1c94..5b3501b3a9 100644 --- a/compiler/basicTypes/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -7,7 +7,7 @@ {-# LANGUAGE CPP, DeriveDataTypeable #-} -module DataCon ( +module GHC.Core.DataCon ( -- * Main data types DataCon, DataConRep(..), SrcStrictness(..), SrcUnpackedness(..), @@ -64,15 +64,15 @@ module DataCon ( import GhcPrelude import {-# SOURCE #-} MkId( DataConBoxer ) -import Type -import Coercion -import Unify -import TyCon +import GHC.Core.Type as Type +import GHC.Core.Coercion +import GHC.Core.Unify +import GHC.Core.TyCon import FieldLabel -import Class +import GHC.Core.Class import Name import PrelNames -import Predicate +import GHC.Core.Predicate import Var import Outputable import Util @@ -469,7 +469,7 @@ data DataCon -- The actual fixity is stored elsewhere dcPromoted :: TyCon -- The promoted TyCon - -- See Note [Promoted data constructors] in TyCon + -- See Note [Promoted data constructors] in GHC.Core.TyCon } @@ -479,7 +479,7 @@ For the TyVarBinders in a DataCon and PatSyn: * Each argument flag is Inferred or Specified. None are Required. (A DataCon is a term-level function; see - Note [No Required TyCoBinder in terms] in TyCoRep.) + Note [No Required TyCoBinder in terms] in GHC.Core.TyCo.Rep.) Why do we need the TyVarBinders, rather than just the TyVars? So that we can construct the right type for the DataCon with its foralls @@ -961,7 +961,7 @@ mkDataCon name declared_infix prom_info mkVisFunTys rep_arg_tys $ mkTyConApp rep_tycon (mkTyVarTys univ_tvs) - -- See Note [Promoted data constructors] in TyCon + -- See Note [Promoted data constructors] in GHC.Core.TyCon prom_tv_bndrs = [ mkNamedTyConBinder vis tv | Bndr tv vis <- user_tvbs ] diff --git a/compiler/basicTypes/DataCon.hs-boot b/compiler/GHC/Core/DataCon.hs-boot index a69133463b..0d8957ea60 100644 --- a/compiler/basicTypes/DataCon.hs-boot +++ b/compiler/GHC/Core/DataCon.hs-boot @@ -1,14 +1,14 @@ -module DataCon where +module GHC.Core.DataCon where import GhcPrelude import Var( TyVar, TyCoVar, TyVarBinder ) import Name( Name, NamedThing ) -import {-# SOURCE #-} TyCon( TyCon ) +import {-# SOURCE #-} GHC.Core.TyCon( TyCon ) import FieldLabel ( FieldLabel ) import Unique ( Uniquable ) import Outputable ( Outputable, OutputableBndr ) import BasicTypes (Arity) -import {-# SOURCE #-} TyCoRep ( Type, ThetaType ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, ThetaType ) data DataCon data DataConRep diff --git a/compiler/GHC/Core/FVs.hs b/compiler/GHC/Core/FVs.hs index 00c2bbfe9f..31c10045d6 100644 --- a/compiler/GHC/Core/FVs.hs +++ b/compiler/GHC/Core/FVs.hs @@ -70,12 +70,12 @@ import Unique (Uniquable (..)) import Name import VarSet import Var -import Type -import TyCoRep -import TyCoFVs -import TyCon -import CoAxiom -import FamInstEnv +import GHC.Core.Type +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom +import GHC.Core.FamInstEnv import TysPrim( funTyConName ) import Maybes( orElse ) import Util diff --git a/compiler/types/FamInstEnv.hs b/compiler/GHC/Core/FamInstEnv.hs index 6ebd86900e..c8e5a7a4f9 100644 --- a/compiler/types/FamInstEnv.hs +++ b/compiler/GHC/Core/FamInstEnv.hs @@ -7,7 +7,7 @@ {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} -module FamInstEnv ( +module GHC.Core.FamInstEnv ( FamInst(..), FamFlavor(..), famInstAxiom, famInstTyCon, famInstRHS, famInstsRepTyCons, famInstRepTyCon_maybe, dataFamInstRepTyCon, pprFamInst, pprFamInsts, @@ -43,12 +43,12 @@ module FamInstEnv ( import GhcPrelude -import Unify -import Type -import TyCoRep -import TyCon -import Coercion -import CoAxiom +import GHC.Core.Unify +import GHC.Core.Type as Type +import GHC.Core.TyCo.Rep +import GHC.Core.TyCon +import GHC.Core.Coercion +import GHC.Core.Coercion.Axiom import VarSet import VarEnv import Name @@ -106,7 +106,7 @@ data FamInst -- See Note [FamInsts and CoAxioms] , fi_fam :: Name -- Family name -- Used for "rough matching"; same idea as for class instances - -- See Note [Rough-match field] in InstEnv + -- See Note [Rough-match field] in GHC.Core.InstEnv , fi_tcs :: [Maybe Name] -- Top of type args -- INVARIANT: fi_tcs = roughMatchTcs fi_tys @@ -114,7 +114,7 @@ data FamInst -- See Note [FamInsts and CoAxioms] , fi_tvs :: [TyVar] -- Template tyvars for full match , fi_cvs :: [CoVar] -- Template covars for full match -- Like ClsInsts, these variables are always fresh - -- See Note [Template tyvars are fresh] in InstEnv + -- See Note [Template tyvars are fresh] in GHC.Core.InstEnv , fi_tys :: [Type] -- The LHS type patterns -- May be eta-reduced; see Note [Eta reduction for data families] @@ -479,7 +479,7 @@ irrelevant (clause 1 of compatible) or benign (clause 2 of compatible). Note [Compatibility of eta-reduced axioms] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In newtype instances of data families we eta-reduce the axioms, -See Note [Eta reduction for data families] in FamInstEnv. This means that +See Note [Eta reduction for data families] in GHC.Core.FamInstEnv. This means that we sometimes need to test compatibility of two axioms that were eta-reduced to different degrees, e.g.: @@ -560,7 +560,7 @@ injectiveBranches injectivity -- takes a CoAxiom with unknown branch incompatibilities and computes -- the compatibilities --- See Note [Storing compatibility] in CoAxiom +-- See Note [Storing compatibility] in GHC.Core.Coercion.Axiom computeAxiomIncomps :: [CoAxBranch] -> [CoAxBranch] computeAxiomIncomps branches = snd (mapAccumL go [] branches) @@ -580,7 +580,7 @@ computeAxiomIncomps branches * * Constructing axioms These functions are here because tidyType / tcUnifyTysFG - are not available in CoAxiom + are not available in GHC.Core.Coercion.Axiom Also computeAxiomIncomps is too sophisticated for CoAxiom * * @@ -629,7 +629,7 @@ here: Which is at least legal syntax. -See also Note [CoAxBranch type variables] in CoAxiom; note that we +See also Note [CoAxBranch type variables] in GHC.Core.Coercion.Axiom; note that we are tidying (changing OccNames only), not freshening, in accordance with that Note. -} @@ -657,7 +657,7 @@ mkCoAxBranch tvs eta_tvs cvs lhs rhs roles loc (env2, eta_tvs') = tidyVarBndrs env1 eta_tvs (env, cvs') = tidyVarBndrs env2 cvs -- See Note [Tidy axioms when we build them] - -- See also Note [CoAxBranch type variables] in CoAxiom + -- See also Note [CoAxBranch type variables] in GHC.Core.Coercion.Axiom init_occ_env = initTidyOccEnv [mkTyVarOcc "_"] init_tidy_env = mkEmptyTidyEnv init_occ_env @@ -711,7 +711,7 @@ mkNewTypeCoAxiom :: Name -> TyCon -> [TyVar] -> [Role] -> Type -> CoAxiom Unbran mkNewTypeCoAxiom name tycon tvs roles rhs_ty = CoAxiom { co_ax_unique = nameUnique name , co_ax_name = name - , co_ax_implicit = True -- See Note [Implicit axioms] in TyCon + , co_ax_implicit = True -- See Note [Implicit axioms] in GHC.Core.TyCon , co_ax_role = Representational , co_ax_tc = tycon , co_ax_branches = unbranched (branch { cab_incomps = [] }) } @@ -829,7 +829,7 @@ conditions hold: 1. For each pair of *different* equations of a type family, one of the following conditions holds: - A: RHSs are different. (Check done in FamInstEnv.injectiveBranches) + A: RHSs are different. (Check done in GHC.Core.FamInstEnv.injectiveBranches) B1: OPEN TYPE FAMILIES: If the RHSs can be unified under some substitution then it must be possible to unify the LHSs under the same substitution. @@ -841,7 +841,7 @@ conditions hold: RHSs of these two equations unify under [ a |-> Int ] substitution. Under this substitution LHSs are equal therefore these equations don't - violate injectivity annotation. (Check done in FamInstEnv.injectiveBranches) + violate injectivity annotation. (Check done in GHC.Core.FamInstEnv.injectiveBranches) B2: CLOSED TYPE FAMILIES: If the RHSs can be unified under some substitution then either the LHSs unify under the same substitution or @@ -902,7 +902,7 @@ imported equations led to #17405, as the behavior of check (4) depends on -XUndecidableInstances (see Note [Coverage condition for injective type families] in FamInst), which may vary between modules. -See also Note [Injective type families] in TyCon +See also Note [Injective type families] in GHC.Core.TyCon -} @@ -1218,7 +1218,7 @@ type. However, an ordinary TCvSubst just won't do: when we hit a type variable whose kind has changed during normalisation, we need both the new type variable *and* the coercion. We could conjure up a new VarEnv with just this property, but a usable substitution environment already exists: -LiftingContexts from the liftCoSubst family of functions, defined in Coercion. +LiftingContexts from the liftCoSubst family of functions, defined in GHC.Core.Coercion. A LiftingContext maps a type variable to a coercion and a coercion variable to a pair of coercions. Let's ignore coercion variables for now. Because the coercion a type variable maps to contains the destination type (via diff --git a/compiler/types/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs index 6fcdc8e246..51c1db1b25 100644 --- a/compiler/types/InstEnv.hs +++ b/compiler/GHC/Core/InstEnv.hs @@ -9,7 +9,7 @@ The bits common to TcInstDcls and TcDeriv. {-# LANGUAGE CPP, DeriveDataTypeable #-} -module InstEnv ( +module GHC.Core.InstEnv ( DFunId, InstMatch, ClsInstLookupResult, OverlapFlag(..), OverlapMode(..), setOverlapModeMaybe, ClsInst(..), DFunInstType, pprInstance, pprInstanceHdr, pprInstances, @@ -37,12 +37,12 @@ import TcType -- InstEnv is really part of the type checker, -- and depends on TcType in many ways import GHC.Core ( IsOrphan(..), isOrphan, chooseOrphanAnchor ) import Module -import Class +import GHC.Core.Class import Var import VarSet import Name import NameSet -import Unify +import GHC.Core.Unify import Outputable import ErrUtils import BasicTypes @@ -276,7 +276,7 @@ mkLocalInstance dfun oflag tvs cls tys this_mod = ASSERT( isExternalName dfun_name ) nameModule dfun_name is_local name = nameIsLocalOrFrom this_mod name - -- Compute orphanhood. See Note [Orphans] in InstEnv + -- Compute orphanhood. See Note [Orphans] in GHC.Core.InstEnv (cls_tvs, fds) = classTvsFds cls arg_names = [filterNameSet is_local (orphNamesOfType ty) | ty <- tys] diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs index d3598dc722..b22705eb6f 100644 --- a/compiler/GHC/Core/Lint.hs +++ b/compiler/GHC/Core/Lint.hs @@ -32,7 +32,7 @@ import GHC.Core.Stats ( coreBindsStats ) import CoreMonad import Bag import Literal -import DataCon +import GHC.Core.DataCon import TysWiredIn import TysPrim import TcType ( isFloatingTy ) @@ -45,16 +45,16 @@ import Id import IdInfo import GHC.Core.Ppr import ErrUtils -import Coercion +import GHC.Core.Coercion import SrcLoc -import Type +import GHC.Core.Type as Type import GHC.Types.RepType -import TyCoRep -- checks validity of types/coercions -import TyCoSubst -import TyCoFVs -import TyCoPpr ( pprTyVar ) -import TyCon -import CoAxiom +import GHC.Core.TyCo.Rep -- checks validity of types/coercions +import GHC.Core.TyCo.Subst +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr ( pprTyVar ) +import GHC.Core.TyCon as TyCon +import GHC.Core.Coercion.Axiom import BasicTypes import ErrUtils as Err import ListSetOps @@ -62,9 +62,9 @@ import PrelNames import Outputable import FastString import Util -import InstEnv ( instanceDFunId ) -import OptCoercion ( checkAxInstCo ) -import GHC.Core.Arity ( typeArity ) +import GHC.Core.InstEnv ( instanceDFunId ) +import GHC.Core.Coercion.Opt ( checkAxInstCo ) +import GHC.Core.Arity ( typeArity ) import Demand ( splitStrictSig, isBotDiv ) import GHC.Driver.Types @@ -1087,7 +1087,7 @@ lintTyApp fun_ty arg_ty ; in_scope <- getInScope -- substTy needs the set of tyvars in scope to avoid generating -- uniques that are already in scope. - -- See Note [The substitution invariant] in TyCoSubst + -- See Note [The substitution invariant] in GHC.Core.TyCo.Subst ; return (substTyWithInScope in_scope [tv] [arg_ty] body_ty) } | otherwise @@ -1466,7 +1466,7 @@ lintType t@(ForAllTy (Bndr cv _vis) ty) ; checkValueKind k (text "the body of forall:" <+> ppr t) ; return liftedTypeKind -- We don't check variable escape here. Namely, k could refer to cv' - -- See Note [NthCo and newtypes] in TyCoRep + -- See Note [NthCo and newtypes] in GHC.Core.TyCo.Rep }} lintType ty@(LitTy l) = lintTyLit l >> return (typeKind ty) @@ -1585,7 +1585,7 @@ lint_app :: SDoc -> LintedKind -> [(LintedType,LintedKind)] -> LintM Kind lint_app doc kfn kas = do { in_scope <- getInScope -- We need the in_scope set to satisfy the invariant in - -- Note [The substitution invariant] in TyCoSubst + -- Note [The substitution invariant] in GHC.Core.TyCo.Subst ; foldlM (go_app in_scope) kfn kas } where fail_msg extra = vcat [ hang (text "Kind application error in") 2 doc @@ -1807,7 +1807,7 @@ lintCoercion (ForAllCo tv1 kind_co co) -- scope. All the free vars of `t2` and `kind_co` should -- already be in `in_scope`, because they've been -- linted and `tv2` has the same unique as `tv1`. - -- See Note [The substitution invariant] in TyCoSubst. + -- See Note [The substitution invariant] in GHC.Core.TyCo.Subst. unitVarEnv tv1 (TyVarTy tv2 `mkCastTy` mkSymCo kind_co) tyr = mkInvForAllTy tv2 $ substTy subst t2 @@ -1825,7 +1825,7 @@ lintCoercion (ForAllCo cv1 kind_co co) ; (k3, k4, t1, t2, r) <- lintCoercion co ; checkValueKind k3 (text "the body of a ForAllCo over covar:" <+> ppr co) ; checkValueKind k4 (text "the body of a ForAllCo over covar:" <+> ppr co) - -- See Note [Weird typing rule for ForAllTy] in Type + -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type ; in_scope <- getInScope ; let tyl = mkTyCoInvForAllTy cv1 t1 r2 = coVarRole cv1 @@ -1838,13 +1838,13 @@ lintCoercion (ForAllCo cv1 kind_co co) -- scope. All the free vars of `t2` and `kind_co` should -- already be in `in_scope`, because they've been -- linted and `cv2` has the same unique as `cv1`. - -- See Note [The substitution invariant] in TyCoSubst. + -- See Note [The substitution invariant] in GHC.Core.TyCo.Subst. unitVarEnv cv1 (eta1 `mkTransCo` (mkCoVarCo cv2) `mkTransCo` (mkSymCo eta2)) tyr = mkTyCoInvForAllTy cv2 $ substTy subst t2 ; return (liftedTypeKind, liftedTypeKind, tyl, tyr, r) } } - -- See Note [Weird typing rule for ForAllTy] in Type + -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type lintCoercion co@(FunCo r co1 co2) = do { (k1,k'1,s1,t1,r1) <- lintCoercion co1 @@ -1964,7 +1964,7 @@ lintCoercion the_co@(NthCo r0 n co) { (Just (tc_s, tys_s), Just (tc_t, tys_t)) | tc_s == tc_t , isInjectiveTyCon tc_s r - -- see Note [NthCo and newtypes] in TyCoRep + -- see Note [NthCo and newtypes] in GHC.Core.TyCo.Rep , tys_s `equalLength` tys_t , tys_s `lengthExceeds` n -> do { lintRole the_co tr r0 @@ -2018,7 +2018,7 @@ lintCoercion (InstCo co arg) , CoercionTy s2' <- s2 -> do { return $ (liftedTypeKind, liftedTypeKind - -- See Note [Weird typing rule for ForAllTy] in Type + -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type , substTy (mkCvSubst in_scope $ unitVarEnv cv1 s1') t1 , substTy (mkCvSubst in_scope $ unitVarEnv cv2 s2') t2 , r) } diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs index 540ecfbe56..17fc146608 100644 --- a/compiler/GHC/Core/Make.hs +++ b/compiler/GHC/Core/Make.hs @@ -68,10 +68,10 @@ import TysWiredIn import PrelNames import GHC.Hs.Utils ( mkChunkified, chunkify ) -import Type -import Coercion ( isCoVar ) +import GHC.Core.Type +import GHC.Core.Coercion ( isCoVar ) +import GHC.Core.DataCon ( DataCon, dataConWorkId ) import TysPrim -import DataCon ( DataCon, dataConWorkId ) import IdInfo import Demand import Cpr diff --git a/compiler/GHC/Core/Map.hs b/compiler/GHC/Core/Map.hs index ee12bdd8a3..c3e765ff2b 100644 --- a/compiler/GHC/Core/Map.hs +++ b/compiler/GHC/Core/Map.hs @@ -41,10 +41,10 @@ import GhcPrelude import TrieMap import GHC.Core -import Coercion +import GHC.Core.Coercion import Name -import Type -import TyCoRep +import GHC.Core.Type +import GHC.Core.TyCo.Rep import Var import FastString(FastString) import Util @@ -475,10 +475,10 @@ data TypeMapX a , tm_tylit :: TyLitMap a , tm_coerce :: Maybe a } - -- Note that there is no tyconapp case; see Note [Equality on AppTys] in Type + -- Note that there is no tyconapp case; see Note [Equality on AppTys] in GHC.Core.Type -- | Squeeze out any synonyms, and change TyConApps to nested AppTys. Why the --- last one? See Note [Equality on AppTys] in Type +-- last one? See Note [Equality on AppTys] in GHC.Core.Type -- -- Note, however, that we keep Constraint and Type apart here, despite the fact -- that they are both synonyms of TYPE 'LiftedRep (see #11715). @@ -515,7 +515,7 @@ instance Eq (DeBruijn Type) where (Just bv, Just bv') -> bv == bv' (Nothing, Nothing) -> v == v' _ -> False - -- See Note [Equality on AppTys] in Type + -- See Note [Equality on AppTys] in GHC.Core.Type (AppTy t1 t2, s) | Just (t1', t2') <- repSplitAppTy_maybe s -> D env t1 == D env' t1' && D env t2 == D env' t2' (s, AppTy t1' t2') | Just (t1, t2) <- repSplitAppTy_maybe s diff --git a/compiler/GHC/Core/Op/Tidy.hs b/compiler/GHC/Core/Op/Tidy.hs index 8ddd3708c3..60db2c8fea 100644 --- a/compiler/GHC/Core/Op/Tidy.hs +++ b/compiler/GHC/Core/Op/Tidy.hs @@ -22,8 +22,8 @@ import GHC.Core.Seq ( seqUnfolding ) import Id import IdInfo import Demand ( zapUsageEnvSig ) -import Type( tidyType, tidyVarBndr ) -import Coercion( tidyCo ) +import GHC.Core.Type ( tidyType, tidyVarBndr ) +import GHC.Core.Coercion ( tidyCo ) import Var import VarEnv import UniqFM diff --git a/compiler/basicTypes/PatSyn.hs b/compiler/GHC/Core/PatSyn.hs index e53279f668..7f84e92e3f 100644 --- a/compiler/basicTypes/PatSyn.hs +++ b/compiler/GHC/Core/PatSyn.hs @@ -7,7 +7,7 @@ {-# LANGUAGE CPP #-} -module PatSyn ( +module GHC.Core.PatSyn ( -- * Main data types PatSyn, mkPatSyn, @@ -26,8 +26,8 @@ module PatSyn ( import GhcPrelude -import Type -import TyCoPpr +import GHC.Core.Type +import GHC.Core.TyCo.Ppr import Name import Outputable import Unique diff --git a/compiler/basicTypes/PatSyn.hs-boot b/compiler/GHC/Core/PatSyn.hs-boot index 1a79159f7b..8ce7621450 100644 --- a/compiler/basicTypes/PatSyn.hs-boot +++ b/compiler/GHC/Core/PatSyn.hs-boot @@ -1,7 +1,7 @@ -module PatSyn where +module GHC.Core.PatSyn where import BasicTypes (Arity) -import {-# SOURCE #-} TyCoRep (Type) +import {-# SOURCE #-} GHC.Core.TyCo.Rep (Type) import Var (TyVar) import Name (Name) diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs index bd2b968ef4..0ab98c3208 100644 --- a/compiler/GHC/Core/Ppr.hs +++ b/compiler/GHC/Core/Ppr.hs @@ -28,10 +28,10 @@ import Id import IdInfo import Demand import Cpr -import DataCon -import TyCon -import TyCoPpr -import Coercion +import GHC.Core.DataCon +import GHC.Core.TyCon +import GHC.Core.TyCo.Ppr +import GHC.Core.Coercion import BasicTypes import Maybes import Util diff --git a/compiler/GHC/Core/Ppr/TyThing.hs b/compiler/GHC/Core/Ppr/TyThing.hs index 6e092498d9..bf3450c447 100644 --- a/compiler/GHC/Core/Ppr/TyThing.hs +++ b/compiler/GHC/Core/Ppr/TyThing.hs @@ -21,14 +21,14 @@ module GHC.Core.Ppr.TyThing ( import GhcPrelude -import Type ( Type, ArgFlag(..), TyThing(..), mkTyVarBinders, tidyOpenType ) +import GHC.Core.Type ( Type, ArgFlag(..), TyThing(..), mkTyVarBinders, tidyOpenType ) import GHC.Iface.Syntax ( ShowSub(..), ShowHowMuch(..), AltPpr(..) , showToHeader, pprIfaceDecl ) -import CoAxiom ( coAxiomTyCon ) +import GHC.Core.Coercion.Axiom ( coAxiomTyCon ) import GHC.Driver.Types( tyThingParent_maybe ) import GHC.Iface.Make ( tyThingToIfaceDecl ) -import FamInstEnv( FamInst(..), FamFlavor(..) ) -import TyCoPpr ( pprUserForAll, pprTypeApp, pprSigmaType ) +import GHC.Core.FamInstEnv( FamInst(..), FamFlavor(..) ) +import GHC.Core.TyCo.Ppr ( pprUserForAll, pprTypeApp, pprSigmaType ) import Name import VarEnv( emptyTidyEnv ) import Outputable diff --git a/compiler/basicTypes/Predicate.hs b/compiler/GHC/Core/Predicate.hs index be9254dd70..e84333283d 100644 --- a/compiler/basicTypes/Predicate.hs +++ b/compiler/GHC/Core/Predicate.hs @@ -4,7 +4,7 @@ Describes predicates as they are considered by the solver. -} -module Predicate ( +module GHC.Core.Predicate ( Pred(..), classifyPredType, isPredTy, isEvVarType, @@ -30,11 +30,11 @@ module Predicate ( import GhcPrelude -import Type -import Class -import TyCon +import GHC.Core.Type +import GHC.Core.Class +import GHC.Core.TyCon import Var -import Coercion +import GHC.Core.Coercion import PrelNames @@ -159,7 +159,7 @@ in TcCanonical. isEvVarType :: Type -> Bool -- True of (a) predicates, of kind Constraint, such as (Eq a), and (a ~ b) -- (b) coercion types, such as (t1 ~# t2) or (t1 ~R# t2) --- See Note [Types for coercions, predicates, and evidence] in TyCoRep +-- See Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep -- See Note [Evidence for quantified constraints] isEvVarType ty = isCoVarType ty || isPredTy ty diff --git a/compiler/GHC/Core/Rules.hs b/compiler/GHC/Core/Rules.hs index 9d2a209993..31b27b03e6 100644 --- a/compiler/GHC/Core/Rules.hs +++ b/compiler/GHC/Core/Rules.hs @@ -40,11 +40,12 @@ import GHC.Core.Utils ( exprType, eqExpr, mkTick, mkTicks , stripTicksTopT, stripTicksTopE , isJoinBind ) import GHC.Core.Ppr ( pprRules ) -import Type ( Type, TCvSubst, extendTvSubst, extendCvSubst - , mkEmptyTCvSubst, substTy ) +import GHC.Core.Type as Type + ( Type, TCvSubst, extendTvSubst, extendCvSubst + , mkEmptyTCvSubst, substTy ) import TcType ( tcSplitTyConApp_maybe ) import TysWiredIn ( anyTypeOfKind ) -import Coercion +import GHC.Core.Coercion as Coercion import GHC.Core.Op.Tidy ( tidyRules ) import Id import IdInfo ( RuleInfo( RuleInfo ) ) @@ -55,7 +56,7 @@ import Name ( Name, NamedThing(..), nameIsLocalOrFrom ) import NameSet import NameEnv import UniqFM -import Unify ( ruleMatchTyKiX ) +import GHC.Core.Unify as Unify ( ruleMatchTyKiX ) import BasicTypes import GHC.Driver.Session ( DynFlags ) import Outputable @@ -181,7 +182,7 @@ mkRule this_mod is_auto is_local name act fn bndrs args rhs ru_orphan = orph, ru_auto = is_auto, ru_local = is_local } where - -- Compute orphanhood. See Note [Orphans] in InstEnv + -- Compute orphanhood. See Note [Orphans] in GHC.Core.InstEnv -- A rule is an orphan only if none of the variables -- mentioned on its left-hand side are locally defined lhs_names = extendNameSet (exprsOrphNames args) fn @@ -734,7 +735,7 @@ match _ _ e@Tick{} _ -- might substitute [a/b] in the template, and then erroneously -- succeed in matching what looks like the template variable 'a' against 3. --- The Var case follows closely what happens in Unify.match +-- The Var case follows closely what happens in GHC.Core.Unify.match match renv subst (Var v1) e2 = match_var renv subst v1 e2 diff --git a/compiler/GHC/Core/Seq.hs b/compiler/GHC/Core/Seq.hs index 5c600296e0..13a0841503 100644 --- a/compiler/GHC/Core/Seq.hs +++ b/compiler/GHC/Core/Seq.hs @@ -19,8 +19,8 @@ import Cpr( seqCprSig ) import BasicTypes( seqOccInfo ) import VarSet( seqDVarSet ) import Var( varType, tyVarKind ) -import Type( seqType, isTyVar ) -import Coercion( seqCo ) +import GHC.Core.Type( seqType, isTyVar ) +import GHC.Core.Coercion( seqCo ) import Id( Id, idInfo ) -- | Evaluate all the fields of the 'IdInfo' that are generally demanded by the diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs index f9665140b1..829e746498 100644 --- a/compiler/GHC/Core/SimpleOpt.hs +++ b/compiler/GHC/Core/SimpleOpt.hs @@ -38,13 +38,13 @@ import IdInfo ( unfoldingInfo, setUnfoldingInfo, setRuleInfo, IdInfo (..) ) import Var ( isNonCoVarId ) import VarSet import VarEnv -import DataCon +import GHC.Core.DataCon import Demand( etaExpandStrictSig ) -import OptCoercion ( optCoercion ) -import Type hiding ( substTy, extendTvSubst, extendCvSubst, extendTvSubstList - , isInScope, substTyVarBndr, cloneTyVarBndr ) -import Coercion hiding ( substCo, substCoVarBndr ) -import TyCon ( tyConArity ) +import GHC.Core.Coercion.Opt ( optCoercion ) +import GHC.Core.Type hiding ( substTy, extendTvSubst, extendCvSubst, extendTvSubstList + , isInScope, substTyVarBndr, cloneTyVarBndr ) +import GHC.Core.Coercion hiding ( substCo, substCoVarBndr ) +import GHC.Core.TyCon ( tyConArity ) import TysWiredIn import PrelNames import BasicTypes diff --git a/compiler/GHC/Core/Stats.hs b/compiler/GHC/Core/Stats.hs index fe288f5348..148255e140 100644 --- a/compiler/GHC/Core/Stats.hs +++ b/compiler/GHC/Core/Stats.hs @@ -16,9 +16,9 @@ import GhcPrelude import BasicTypes import GHC.Core import Outputable -import Coercion +import GHC.Core.Coercion import Var -import Type (Type, typeSize) +import GHC.Core.Type(Type, typeSize) import Id (isJoinId) data CoreStats = CS { cs_tm :: !Int -- Terms diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index e61088a277..672786aaa6 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -43,13 +43,14 @@ import GHC.Core import GHC.Core.FVs import GHC.Core.Seq import GHC.Core.Utils -import qualified Type -import qualified Coercion +import qualified GHC.Core.Type as Type +import qualified GHC.Core.Coercion as Coercion -- We are defining local versions -import Type hiding ( substTy, extendTvSubst, extendCvSubst, extendTvSubstList - , isInScope, substTyVarBndr, cloneTyVarBndr ) -import Coercion hiding ( substCo, substCoVarBndr ) +import GHC.Core.Type hiding + ( substTy, extendTvSubst, extendCvSubst, extendTvSubstList + , isInScope, substTyVarBndr, cloneTyVarBndr ) +import GHC.Core.Coercion hiding ( substCo, substCoVarBndr ) import PrelNames import VarSet @@ -79,9 +80,9 @@ import Data.List -- -- Some invariants apply to how you use the substitution: -- --- 1. Note [The substitution invariant] in TyCoSubst +-- 1. Note [The substitution invariant] in GHC.Core.TyCo.Subst -- --- 2. Note [Substitutions apply only once] in TyCoSubst +-- 2. Note [Substitutions apply only once] in GHC.Core.TyCo.Subst data Subst = Subst InScopeSet -- Variables in in scope (both Ids and TyVars) /after/ -- applying the substitution @@ -104,7 +105,7 @@ Note [Extending the Subst] For a core Subst, which binds Ids as well, we make a different choice for Ids than we do for TyVars. -For TyVars, see Note [Extending the TCvSubst] in TyCoSubst. +For TyVars, see Note [Extending the TCvSubst] in GHC.Core.TyCo.Subst. For Ids, we have a different invariant The IdSubstEnv is extended *only* when the Unique on an Id changes @@ -339,7 +340,7 @@ instance Outputable Subst where -- | Apply a substitution to an entire 'CoreExpr'. Remember, you may only -- apply the substitution /once/: --- See Note [Substitutions apply only once] in TyCoSubst +-- See Note [Substitutions apply only once] in GHC.Core.TyCo.Subst -- -- Do *not* attempt to short-cut in the case of an empty substitution! -- See Note [Extending the Subst] diff --git a/compiler/types/TyCoFVs.hs b/compiler/GHC/Core/TyCo/FVs.hs index e275d60e6b..82d7699ed3 100644 --- a/compiler/types/TyCoFVs.hs +++ b/compiler/GHC/Core/TyCo/FVs.hs @@ -1,6 +1,6 @@ {-# LANGUAGE CPP #-} -module TyCoFVs +module GHC.Core.TyCo.FVs ( shallowTyCoVarsOfType, shallowTyCoVarsOfTypes, tyCoVarsOfType, tyCoVarsOfTypes, tyCoVarsOfTypeDSet, tyCoVarsOfTypesDSet, @@ -45,11 +45,11 @@ module TyCoFVs import GhcPrelude -import {-# SOURCE #-} Type (coreView, partitionInvisibleTypes) +import {-# SOURCE #-} GHC.Core.Type (coreView, partitionInvisibleTypes) import Data.Monoid as DM ( Endo(..), All(..) ) -import TyCoRep -import TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.TyCon import Var import FV @@ -314,7 +314,7 @@ deepTcvFolder = TyCoFolder { tcf_view = noView do_bndr is tcv _ = extendVarSet is tcv do_hole is hole = do_tcv is (coHoleCoVar hole) -- See Note [CoercionHoles and coercion free variables] - -- in TyCoRep + -- in GHC.Core.TyCo.Rep {- ********************************************************************* * * @@ -427,7 +427,7 @@ deepCoVarFolder = TyCoFolder { tcf_view = noView do_bndr is tcv _ = extendVarSet is tcv do_hole is hole = do_covar is (coHoleCoVar hole) -- See Note [CoercionHoles and coercion free variables] - -- in TyCoRep + -- in GHC.Core.TyCo.Rep {- ********************************************************************* @@ -655,7 +655,7 @@ tyCoFVsOfCos (co:cos) fv_cand in_scope acc = (tyCoFVsOfCo co `unionFV` tyCoFVsOf -- | Given a covar and a coercion, returns True if covar is almost devoid in -- the coercion. That is, covar can only appear in Refl and GRefl. --- See last wrinkle in Note [Unused coercion variable in ForAllCo] in Coercion +-- See last wrinkle in Note [Unused coercion variable in ForAllCo] in GHC.Core.Coercion almostDevoidCoVarOfCo :: CoVar -> Coercion -> Bool almostDevoidCoVarOfCo cv co = almost_devoid_co_var_of_co co cv @@ -829,7 +829,7 @@ injectiveVarsOfTypes look_under_tfs = mapUnionFV (injectiveVarsOfType look_under -- * In the kind of a bound variable in a forall -- * In a coercion -- * In a Specified or Inferred argument to a function --- See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep +-- See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep invisibleVarsOfType :: Type -> FV invisibleVarsOfType = go where diff --git a/compiler/types/TyCoPpr.hs b/compiler/GHC/Core/TyCo/Ppr.hs index f1a36feca9..3d4c065aba 100644 --- a/compiler/types/TyCoPpr.hs +++ b/compiler/GHC/Core/TyCo/Ppr.hs @@ -1,5 +1,5 @@ -- | Pretty-printing types and coercions. -module TyCoPpr +module GHC.Core.TyCo.Ppr ( -- * Precedence PprPrec(..), topPrec, sigPrec, opPrec, funPrec, appPrec, maybeParen, @@ -31,17 +31,18 @@ import {-# SOURCE #-} GHC.CoreToIface ( toIfaceTypeX, toIfaceTyLit, toIfaceForAllBndr , toIfaceTyCon, toIfaceTcArgs, toIfaceCoercionX ) -import {-# SOURCE #-} DataCon( dataConFullSig - , dataConUserTyVarBinders - , DataCon ) +import {-# SOURCE #-} GHC.Core.DataCon + ( dataConFullSig , dataConUserTyVarBinders + , DataCon ) -import {-# SOURCE #-} Type( isLiftedTypeKind ) +import {-# SOURCE #-} GHC.Core.Type + ( isLiftedTypeKind ) -import TyCon -import TyCoRep -import TyCoTidy -import TyCoFVs -import Class +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Tidy +import GHC.Core.TyCo.FVs +import GHC.Core.Class import Var import GHC.Iface.Type diff --git a/compiler/types/TyCoPpr.hs-boot b/compiler/GHC/Core/TyCo/Ppr.hs-boot index 127dfb32d8..64562d9a28 100644 --- a/compiler/types/TyCoPpr.hs-boot +++ b/compiler/GHC/Core/TyCo/Ppr.hs-boot @@ -1,6 +1,6 @@ -module TyCoPpr where +module GHC.Core.TyCo.Ppr where -import {-# SOURCE #-} TyCoRep (Type, Kind, Coercion, TyLit) +import {-# SOURCE #-} GHC.Core.TyCo.Rep (Type, Kind, Coercion, TyLit) import Outputable pprType :: Type -> SDoc diff --git a/compiler/types/TyCoRep.hs b/compiler/GHC/Core/TyCo/Rep.hs index 75a031b799..26c01ebcb8 100644 --- a/compiler/types/TyCoRep.hs +++ b/compiler/GHC/Core/TyCo/Rep.hs @@ -1,27 +1,27 @@ {- (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1998 -\section[TyCoRep]{Type and Coercion - friends' interface} +\section[GHC.Core.TyCo.Rep]{Type and Coercion - friends' interface} Note [The Type-related module hierarchy] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Class - CoAxiom - TyCon imports Class, CoAxiom - TyCoRep imports Class, CoAxiom, TyCon - TyCoPpr imports TyCoRep - TyCoFVs imports TyCoRep - TyCoSubst imports TyCoRep, TyCoFVs, TyCoPpr - TyCoTidy imports TyCoRep, TyCoFVs - TysPrim imports TyCoRep ( including mkTyConTy ) - Coercion imports Type + GHC.Core.Class + GHC.Core.Coercion.Axiom + GHC.Core.TyCon imports GHC.Core.{Class, Coercion.Axiom} + GHC.Core.TyCo.Rep imports GHC.Core.{Class, Coercion.Axiom, TyCon} + GHC.Core.TyCo.Ppr imports GHC.Core.TyCo.Rep + GHC.Core.TyCo.FVs imports GHC.Core.TyCo.Rep + GHC.Core.TyCo.Subst imports GHC.Core.TyCo.{Rep, FVs, Ppr} + GHC.Core.TyCo.Tidy imports GHC.Core.TyCo.{Rep, FVs} + TysPrim imports GHC.Core.TyCo.Rep ( including mkTyConTy ) + GHC.Core.Coercion imports GHC.Core.Type -} -- We expose the relevant stuff from this module via the Type module {-# OPTIONS_HADDOCK not-home #-} {-# LANGUAGE CPP, DeriveDataTypeable, MultiWayIf, PatternSynonyms, BangPatterns #-} -module TyCoRep ( +module GHC.Core.TyCo.Rep ( TyThing(..), tyThingCategory, pprTyThingCategory, pprShortTyThing, -- * Types @@ -72,19 +72,19 @@ module TyCoRep ( import GhcPrelude -import {-# SOURCE #-} TyCoPpr ( pprType, pprCo, pprTyLit ) +import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType, pprCo, pprTyLit ) -- Transitively pulls in a LOT of stuff, better to break the loop -import {-# SOURCE #-} ConLike ( ConLike(..), conLikeName ) +import {-# SOURCE #-} GHC.Core.ConLike ( ConLike(..), conLikeName ) -- friends: import GHC.Iface.Type import Var import VarSet import Name hiding ( varName ) -import TyCon -import CoAxiom +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom -- others import BasicTypes ( LeftOrRight(..), pickLR ) @@ -369,7 +369,7 @@ How does this work? data T a b where MkT :: (a~b) => a -> b -> T a b See DataCon.mkPromotedDataCon - and Note [Promoted data constructors] in TyCon + and Note [Promoted data constructors] in GHC.Core.TyCon * We support both homogeneous (~) and heterogeneous (~~) equality. (See Note [The equality types story] @@ -578,7 +578,7 @@ In sum, in order to uphold (EQ), we need the following three invariants: (EQ2) No reflexive casts in CastTy. (EQ3) No nested CastTys. (EQ4) No CastTy over (ForAllTy (Bndr tyvar vis) body). - See Note [Weird typing rule for ForAllTy] in Type. + See Note [Weird typing rule for ForAllTy] in GHC.Core.Type. These invariants are all documented above, in the declaration for Type. @@ -1653,14 +1653,14 @@ Note [mapType vs foldType] ~~~~~~~~~~~~~~~~~~~~~~~~~~ We define foldType here, but mapType in module Type. Why? -* foldType is used in TyCoFVs for finding free variables. +* foldType is used in GHC.Core.TyCo.FVs for finding free variables. It's a very simple function that analyses a type, but does not construct one. * mapType constructs new types, and so it needs to call the "smart constructors", mkAppTy, mkCastTy, and so on. These are sophisticated functions, and can't be defined - here in TyCoRep. + here in GHC.Core.TyCo.Rep. Note [Specialising foldType] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1726,7 +1726,7 @@ data TyCoFolder env a , tcf_covar :: env -> CoVar -> a , tcf_hole :: env -> CoercionHole -> a -- ^ What to do with coercion holes. - -- See Note [Coercion holes] in TyCoRep. + -- See Note [Coercion holes] in GHC.Core.TyCo.Rep. , tcf_tycobinder :: env -> TyCoVar -> ArgFlag -> env -- ^ The returned env is used in the extended scope diff --git a/compiler/types/TyCoRep.hs-boot b/compiler/GHC/Core/TyCo/Rep.hs-boot index 0050dcd26b..2ffc19795c 100644 --- a/compiler/types/TyCoRep.hs-boot +++ b/compiler/GHC/Core/TyCo/Rep.hs-boot @@ -1,4 +1,4 @@ -module TyCoRep where +module GHC.Core.TyCo.Rep where import Data.Data ( Data ) import {-# SOURCE #-} Var( Var, ArgFlag, AnonArgFlag ) @@ -20,4 +20,4 @@ type MCoercionN = MCoercion mkFunTy :: AnonArgFlag -> Type -> Type -> Type mkForAllTy :: Var -> ArgFlag -> Type -> Type -instance Data Type -- To support Data instances in CoAxiom +instance Data Type -- To support Data instances in GHC.Core.Coercion.Axiom diff --git a/compiler/types/TyCoSubst.hs b/compiler/GHC/Core/TyCo/Subst.hs index 7248713219..14eee30633 100644 --- a/compiler/types/TyCoSubst.hs +++ b/compiler/GHC/Core/TyCo/Subst.hs @@ -9,7 +9,7 @@ Type and Coercion - friends' interface {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} -- | Substitution into types and coercions. -module TyCoSubst +module GHC.Core.TyCo.Subst ( -- * Substitutions TCvSubst(..), TvSubstEnv, CvSubstEnv, @@ -55,18 +55,20 @@ module TyCoSubst import GhcPrelude -import {-# SOURCE #-} Type ( mkCastTy, mkAppTy, isCoercionTy ) -import {-# SOURCE #-} Coercion ( mkCoVarCo, mkKindCo, mkNthCo, mkTransCo - , mkNomReflCo, mkSubCo, mkSymCo - , mkFunCo, mkForAllCo, mkUnivCo - , mkAxiomInstCo, mkAppCo, mkGReflCo - , mkInstCo, mkLRCo, mkTyConAppCo - , mkCoercionType - , coercionKind, coercionLKind, coVarKindsTypesRole ) - -import TyCoRep -import TyCoFVs -import TyCoPpr +import {-# SOURCE #-} GHC.Core.Type + ( mkCastTy, mkAppTy, isCoercionTy ) +import {-# SOURCE #-} GHC.Core.Coercion + ( mkCoVarCo, mkKindCo, mkNthCo, mkTransCo + , mkNomReflCo, mkSubCo, mkSymCo + , mkFunCo, mkForAllCo, mkUnivCo + , mkAxiomInstCo, mkAppCo, mkGReflCo + , mkInstCo, mkLRCo, mkTyConAppCo + , mkCoercionType + , coercionKind, coercionLKind, coVarKindsTypesRole ) + +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs +import GHC.Core.TyCo.Ppr import Var import VarSet diff --git a/compiler/types/TyCoTidy.hs b/compiler/GHC/Core/TyCo/Tidy.hs index 4142075f26..3e41e922cc 100644 --- a/compiler/types/TyCoTidy.hs +++ b/compiler/GHC/Core/TyCo/Tidy.hs @@ -3,7 +3,7 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -- | Tidying types and coercions for printing in error messages. -module TyCoTidy +module GHC.Core.TyCo.Tidy ( -- * Tidying type related things up for printing tidyType, tidyTypes, @@ -20,8 +20,8 @@ module TyCoTidy import GhcPrelude -import TyCoRep -import TyCoFVs (tyCoVarsOfTypesWellScoped, tyCoVarsOfTypeList) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs (tyCoVarsOfTypesWellScoped, tyCoVarsOfTypeList) import Name hiding (varName) import Var diff --git a/compiler/types/TyCon.hs b/compiler/GHC/Core/TyCon.hs index 7f5fde2847..6ee5b27963 100644 --- a/compiler/types/TyCon.hs +++ b/compiler/GHC/Core/TyCon.hs @@ -8,7 +8,7 @@ The @TyCon@ datatype {-# LANGUAGE CPP, FlexibleInstances #-} -module TyCon( +module GHC.Core.TyCon( -- * Main TyCon data types TyCon, AlgTyConRhs(..), visibleDataCons, @@ -135,24 +135,28 @@ module TyCon( import GhcPrelude -import {-# SOURCE #-} TyCoRep ( Kind, Type, PredType, mkForAllTy, mkFunTy ) -import {-# SOURCE #-} TyCoPpr ( pprType ) -import {-# SOURCE #-} TysWiredIn ( runtimeRepTyCon, constraintKind - , vecCountTyCon, vecElemTyCon, liftedTypeKind ) -import {-# SOURCE #-} DataCon ( DataCon, dataConExTyCoVars, dataConFieldLabels - , dataConTyCon, dataConFullSig - , isUnboxedSumCon ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep + ( Kind, Type, PredType, mkForAllTy, mkFunTy ) +import {-# SOURCE #-} GHC.Core.TyCo.Ppr + ( pprType ) +import {-# SOURCE #-} TysWiredIn + ( runtimeRepTyCon, constraintKind + , vecCountTyCon, vecElemTyCon, liftedTypeKind ) +import {-# SOURCE #-} GHC.Core.DataCon + ( DataCon, dataConExTyCoVars, dataConFieldLabels + , dataConTyCon, dataConFullSig + , isUnboxedSumCon ) import Binary import Var import VarSet -import Class +import GHC.Core.Class import BasicTypes import GHC.Driver.Session import ForeignCall import Name import NameEnv -import CoAxiom +import GHC.Core.Coercion.Axiom import PrelNames import Maybes import Outputable @@ -235,10 +239,10 @@ See also Note [Wrappers for data instance tycons] in MkId.hs DataFamInstTyCon T [Int] ax_ti * The axiom ax_ti may be eta-reduced; see - Note [Eta reduction for data families] in FamInstEnv + Note [Eta reduction for data families] in GHC.Core.FamInstEnv * Data family instances may have a different arity than the data family. - See Note [Arity of data families] in FamInstEnv + See Note [Arity of data families] in GHC.Core.FamInstEnv * The data constructor T2 has a wrapper (which is what the source-level "T2" invokes): @@ -401,7 +405,7 @@ must be True. See also: * [Injectivity annotation] in GHC.Hs.Decls * [Renaming injectivity annotation] in GHC.Rename.Source - * [Verifying injectivity annotation] in FamInstEnv + * [Verifying injectivity annotation] in GHC.Core.FamInstEnv * [Type inference for type families with injectivity] in TcInteract ************************************************************************ @@ -517,7 +521,7 @@ can arise in one of two ways: 'MkT :: forall a b. (a~b) => blah - See Note [Constraints in kinds] in TyCoRep, and + See Note [Constraints in kinds] in GHC.Core.TyCo.Rep, and Note [Promoted data constructors] in this module. * In a data type whose kind has an equality constraint, as in the following example from #12102: @@ -583,7 +587,7 @@ The last part about Required->Specified comes from this: data T k (a:k) b = MkT (a b) Here k is Required in T's kind, but we don't have Required binders in the TyCoBinders for a term (see Note [No Required TyCoBinder in terms] -in TyCoRep), so we change it to Specified when making MkT's TyCoBinders +in GHC.Core.TyCo.Rep), so we change it to Specified when making MkT's TyCoBinders -} @@ -613,7 +617,7 @@ They fit together like so: Note that that are three binders here, including the kind variable k. -* See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep +* See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep for what the visibility flag means. * Each TyConBinder tyConBinders has a TyVar (sometimes it is TyCoVar), and @@ -1022,7 +1026,7 @@ mkDataTyConRhs cons data_cons = cons, data_cons_size = length cons, is_enum = not (null cons) && all is_enum_con cons - -- See Note [Enumeration types] in TyCon + -- See Note [Enumeration types] in GHC.Core.TyCon } where is_enum_con con @@ -1070,7 +1074,7 @@ data AlgTyConFlav (Maybe TyConRepName) -- | Type constructors representing a class dictionary. - -- See Note [ATyCon for classes] in TyCoRep + -- See Note [ATyCon for classes] in GHC.Core.TyCo.Rep | ClassTyCon Class -- INVARIANT: the classTyCon of this Class is the -- current tycon @@ -1103,7 +1107,7 @@ data AlgTyConFlav 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 -- E.g. data instance T [a] = ... -- gives a representation tycon: @@ -1193,7 +1197,7 @@ nothing for the axiom to prove! Note [Promoted data constructors] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All data constructors can be promoted to become a type constructor, -via the PromotedDataCon alternative in TyCon. +via the PromotedDataCon alternative in GHC.Core.TyCon. * The TyCon promoted from a DataCon has the *same* Name and Unique as the DataCon. Eg. If the data constructor Data.Maybe.Just(unique 78, @@ -1579,7 +1583,7 @@ So we compromise, and move their Kind calculation to the call site. -} -- | Given the name of the function type constructor and it's kind, create the --- corresponding 'TyCon'. It is recommended to use 'TyCoRep.funTyCon' if you want +-- corresponding 'TyCon'. It is recommended to use 'GHC.Core.TyCo.Rep.funTyCon' if you want -- this functionality mkFunTyCon :: Name -> [TyConBinder] -> Name -> TyCon mkFunTyCon name binders rep_nm @@ -2050,7 +2054,7 @@ isGadtSyntaxTyCon _ = False -- | Is this an algebraic 'TyCon' which is just an enumeration of values? isEnumerationTyCon :: TyCon -> Bool --- See Note [Enumeration types] in TyCon +-- See Note [Enumeration types] in GHC.Core.TyCon isEnumerationTyCon (AlgTyCon { tyConArity = arity, algTcRhs = rhs }) = case rhs of DataTyCon { is_enum = res } -> res diff --git a/compiler/types/TyCon.hs-boot b/compiler/GHC/Core/TyCon.hs-boot index 4db8d0f1c1..84df99b0a9 100644 --- a/compiler/types/TyCon.hs-boot +++ b/compiler/GHC/Core/TyCon.hs-boot @@ -1,4 +1,4 @@ -module TyCon where +module GHC.Core.TyCon where import GhcPrelude diff --git a/compiler/types/Type.hs b/compiler/GHC/Core/Type.hs index 2f87ca7a2f..cab22230aa 100644 --- a/compiler/types/Type.hs +++ b/compiler/GHC/Core/Type.hs @@ -8,7 +8,7 @@ {-# OPTIONS_GHC -Wno-incomplete-record-updates #-} -- | Main functions for manipulating types and type-related things -module Type ( +module GHC.Core.Type ( -- Note some of this is just re-exports from TyCon.. -- * Main data types representing Types @@ -225,13 +225,13 @@ import GhcPrelude import BasicTypes --- We import the representation and primitive functions from TyCoRep. +-- We import the representation and primitive functions from GHC.Core.TyCo.Rep. -- Many things are reexported, but not the representation! -import TyCoRep -import TyCoSubst -import TyCoTidy -import TyCoFVs +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Subst +import GHC.Core.TyCo.Tidy +import GHC.Core.TyCo.FVs -- friends: import Var @@ -239,7 +239,7 @@ import VarEnv import VarSet import UniqSet -import TyCon +import GHC.Core.TyCon import TysPrim import {-# SOURCE #-} TysWiredIn ( listTyCon, typeNatKind , typeSymbolKind, liftedTypeKind @@ -247,15 +247,16 @@ import {-# SOURCE #-} TysWiredIn ( listTyCon, typeNatKind , constraintKind ) import Name( Name ) import PrelNames -import CoAxiom -import {-# SOURCE #-} Coercion( mkNomReflCo, mkGReflCo, mkReflCo - , mkTyConAppCo, mkAppCo, mkCoVarCo, mkAxiomRuleCo - , mkForAllCo, mkFunCo, mkAxiomInstCo, mkUnivCo - , mkSymCo, mkTransCo, mkNthCo, mkLRCo, mkInstCo - , mkKindCo, mkSubCo, mkFunCo, mkAxiomInstCo - , decomposePiCos, coercionKind, coercionLKind - , coercionRKind, coercionType - , isReflexiveCo, seqCo ) +import GHC.Core.Coercion.Axiom +import {-# SOURCE #-} GHC.Core.Coercion + ( mkNomReflCo, mkGReflCo, mkReflCo + , mkTyConAppCo, mkAppCo, mkCoVarCo, mkAxiomRuleCo + , mkForAllCo, mkFunCo, mkAxiomInstCo, mkUnivCo + , mkSymCo, mkTransCo, mkNthCo, mkLRCo, mkInstCo + , mkKindCo, mkSubCo, mkFunCo, mkAxiomInstCo + , decomposePiCos, coercionKind, coercionLKind + , coercionRKind, coercionType + , isReflexiveCo, seqCo ) -- others import Util @@ -358,7 +359,7 @@ tcView (TyConApp tc tys) | Just (tenv, rhs, tys') <- expandSynTyCon_maybe tc tys = Just (mkAppTys (substTy (mkTvSubstPrs tenv) rhs) tys') -- The free vars of 'rhs' should all be bound by 'tenv', so it's -- ok to use 'substTy' here. - -- See also Note [The substitution invariant] in TyCoSubst. + -- See also Note [The substitution invariant] in GHC.Core.TyCo.Subst. -- Its important to use mkAppTys, rather than (foldl AppTy), -- because the function part might well return a -- partially-applied type constructor; indeed, usually will! @@ -566,7 +567,7 @@ on all variables and binding sites. Primarily used for zonking. Note [Efficiency for mapCoercion ForAllCo case] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -As noted in Note [Forall coercions] in TyCoRep, a ForAllCo is a bit redundant. +As noted in Note [Forall coercions] in GHC.Core.TyCo.Rep, a ForAllCo is a bit redundant. It stores a TyCoVar and a Coercion, where the kind of the TyCoVar always matches the left-hand kind of the coercion. This is convenient lots of the time, but not when mapping a function over a coercion. @@ -601,7 +602,7 @@ data TyCoMapper env m , tcm_covar :: env -> CoVar -> m Coercion , tcm_hole :: env -> CoercionHole -> m Coercion -- ^ What to do with coercion holes. - -- See Note [Coercion holes] in TyCoRep. + -- See Note [Coercion holes] in GHC.Core.TyCo.Rep. , tcm_tycobinder :: env -> TyCoVar -> ArgFlag -> m (env, TyCoVar) -- ^ The returned env is used in the extended scope @@ -766,7 +767,7 @@ up decomposing (Eq Int => Int), and we definitely don't want that. This really only applies to the type checker; in Core, '=>' and '->' are the same, as are 'Constraint' and '*'. But for now I've put the test in repSplitAppTy_maybe, which applies throughout, because -the other calls to splitAppTy are in Unify, which is also used by +the other calls to splitAppTy are in GHC.Core.Unify, which is also used by the type checker (e.g. when matching type-function equations). -} @@ -798,7 +799,7 @@ mkAppTys ty1 [] = ty1 mkAppTys (CastTy fun_ty co) arg_tys -- much more efficient then nested mkAppTy -- Why do this? See (EQ1) of -- Note [Respecting definitional equality] - -- in TyCoRep + -- in GHC.Core.TyCo.Rep = foldl' AppTy ((mkAppTys fun_ty casted_arg_tys) `mkCastTy` res_co) leftovers where (arg_cos, res_co) = decomposePiCos co (coercionKind co) arg_tys @@ -1346,7 +1347,7 @@ splitCastTy_maybe _ = Nothing -- | Make a 'CastTy'. The Coercion must be nominal. Checks the -- Coercion for reflexivity, dropping it if it's reflexive. --- See Note [Respecting definitional equality] in TyCoRep +-- See Note [Respecting definitional equality] in GHC.Core.TyCo.Rep mkCastTy :: Type -> Coercion -> Type mkCastTy ty co | isReflexiveCo co = ty -- (EQ2) from the Note -- NB: Do the slow check here. This is important to keep the splitXXX @@ -1382,7 +1383,7 @@ tyConBindersTyCoBinders = map to_tyb -- | Drop the cast on a type, if any. If there is no -- cast, just return the original type. This is rarely what --- you want. The CastTy data constructor (in TyCoRep) has the +-- you want. The CastTy data constructor (in GHC.Core.TyCo.Rep) has the -- invariant that another CastTy is not inside. See the -- data constructor for a full description of this invariant. -- Since CastTy cannot be nested, the result of discardCast @@ -1534,7 +1535,7 @@ and has a type built with mkLamTypes. Conclusion: the easiest thing is to make mkLamType build (c => ty) -when the argument is a predicate type. See TyCoRep +when the argument is a predicate type. See GHC.Core.TyCo.Rep Note [Types for coercions, predicates, and evidence] -} @@ -1931,7 +1932,7 @@ isFamFreeTy (CoercionTy _) = False -- Not sure about this -- | Does this type classify a core (unlifted) Coercion? -- At either role nominal or representational -- (t1 ~# t2) or (t1 ~R# t2) --- See Note [Types for coercions, predicates, and evidence] in TyCoRep +-- See Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep isCoVarType :: Type -> Bool -- ToDo: should we check saturation? isCoVarType ty @@ -2181,7 +2182,7 @@ eqType :: Type -> Type -> Bool -- checks whether the types are equal, ignoring casts and coercions. -- (The kind check is a recursive call, but since all kinds have type -- @Type@, there is no need to check the types of kinds.) --- See also Note [Non-trivial definitional equality] in TyCoRep. +-- See also Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep. eqType t1 t2 = isEqual $ nonDetCmpType t1 t2 -- It's OK to use nonDetCmpType here and eqType is deterministic, -- nonDetCmpType does equality deterministically @@ -2246,7 +2247,7 @@ data TypeOrdering = TLT -- ^ @t1 < t2@ deriving (Eq, Ord, Enum, Bounded) nonDetCmpTypeX :: RnEnv2 -> Type -> Type -> Ordering -- Main workhorse - -- See Note [Non-trivial definitional equality] in TyCoRep + -- See Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep nonDetCmpTypeX env orig_t1 orig_t2 = case go env orig_t1 orig_t2 of -- If there are casts then we also need to do a comparison of the kinds of @@ -2470,7 +2471,8 @@ typeKind ty@(ForAllTy {}) body_kind = typeKind body --------------------------------------------- --- Utilities to be used in Unify, which uses "tc" functions +-- Utilities to be used in GHC.Core.Unify, +-- which uses "tc" functions --------------------------------------------- tcTypeKind :: HasDebugCallStack => Type -> Kind @@ -2515,7 +2517,7 @@ tcTypeKind ty@(ForAllTy {}) isPredTy :: HasDebugCallStack => Type -> Bool --- See Note [Types for coercions, predicates, and evidence] in TyCoRep +-- See Note [Types for coercions, predicates, and evidence] in GHC.Core.TyCo.Rep isPredTy ty = tcIsConstraintKind (tcTypeKind ty) -- tcIsConstraintKind stuff only makes sense in the typechecker @@ -2946,7 +2948,7 @@ classifiesTypeWithValues k = isJust (kindRep_maybe k) %* * %************************************************************************ -Most pretty-printing is either in TyCoRep or GHC.Iface.Type. +Most pretty-printing is either in GHC.Core.TyCo.Rep or GHC.Iface.Type. -} diff --git a/compiler/types/Type.hs-boot b/compiler/GHC/Core/Type.hs-boot index 16c6bfe07b..e2d479be7d 100644 --- a/compiler/types/Type.hs-boot +++ b/compiler/GHC/Core/Type.hs-boot @@ -1,10 +1,10 @@ {-# LANGUAGE FlexibleContexts #-} -module Type where +module GHC.Core.Type where import GhcPrelude -import TyCon -import {-# SOURCE #-} TyCoRep( Type, Coercion ) +import GHC.Core.TyCon +import {-# SOURCE #-} GHC.Core.TyCo.Rep( Type, Coercion ) import Util isPredTy :: HasDebugCallStack => Type -> Bool diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs index a895df36c0..b6e507a7b0 100644 --- a/compiler/GHC/Core/Unfold.hs +++ b/compiler/GHC/Core/Unfold.hs @@ -54,12 +54,12 @@ import GHC.Core.Arity ( manifestArity ) import GHC.Core.Utils import Id import Demand ( isBottomingSig ) -import DataCon +import GHC.Core.DataCon import Literal import PrimOp import IdInfo import BasicTypes ( Arity, InlineSpec(..), inlinePragmaSpec ) -import Type +import GHC.Core.Type import PrelNames import TysPrim ( realWorldStatePrimTy ) import Bag diff --git a/compiler/types/Unify.hs b/compiler/GHC/Core/Unify.hs index 4886f9cdc2..fa188fc022 100644 --- a/compiler/types/Unify.hs +++ b/compiler/GHC/Core/Unify.hs @@ -4,7 +4,7 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} -module Unify ( +module GHC.Core.Unify ( tcMatchTy, tcMatchTyKi, tcMatchTys, tcMatchTyKis, tcMatchTyX, tcMatchTysX, tcMatchTyKisX, @@ -32,12 +32,12 @@ import Var import VarEnv import VarSet import Name( Name ) -import Type hiding ( getTvSubstEnv ) -import Coercion hiding ( getCvSubstEnv ) -import TyCon -import TyCoRep -import TyCoFVs ( tyCoVarsOfCoList, tyCoFVsOfTypes ) -import TyCoSubst ( mkTvSubst ) +import GHC.Core.Type hiding ( getTvSubstEnv ) +import GHC.Core.Coercion hiding ( getCvSubstEnv ) +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.FVs ( tyCoVarsOfCoList, tyCoFVsOfTypes ) +import GHC.Core.TyCo.Subst ( mkTvSubst ) import FV( FV, fvVarSet, fvVarList ) import Util import Pair @@ -228,7 +228,7 @@ matchBindFun tvs tv = if tv `elemVarSet` tvs then BindMe else Skolem * * ********************************************************************* -} --- See Note [Rough match] field in InstEnv +-- See Note [Rough match] field in GHC.Core.InstEnv roughMatchTcs :: [Type] -> [Maybe Name] roughMatchTcs tys = map rough tys @@ -682,7 +682,7 @@ Note [Specification of unification] The pure unifier, unify_ty, defined in this module, tries to work out a substitution to make two types say True to eqType. NB: eqType is itself not purely syntactic; it accounts for CastTys; -see Note [Non-trivial definitional equality] in TyCoRep +see Note [Non-trivial definitional equality] in GHC.Core.TyCo.Rep Unlike the "impure unifiers" in the typechecker (the eager unifier in TcUnify, and the constraint solver itself in TcCanonical), the pure @@ -691,7 +691,7 @@ unifier It does /not/ work up to ~. The algorithm implemented here is rather delicate, and we depend on it to uphold certain properties. This is a summary of these required properties. Any reference to "flattening" refers to the flattening -algorithm in FamInstEnv (See Note [Flattening] in FamInstEnv), not +algorithm in GHC.Core.FamInstEnv (See Note [Flattening] in GHC.Core.FamInstEnv), not the flattening algorithm in the solver. Notation: @@ -1507,7 +1507,7 @@ ty_co_match menv subst (ForAllTy (Bndr tv1 _) ty1) -- subst2 <- ty_co_match menv subst1 s2 eta2 kco3 kco4 -- Question: How do we get kcoi? -- 2. Given: --- lkco :: <*> -- See Note [Weird typing rule for ForAllTy] in Type +-- lkco :: <*> -- See Note [Weird typing rule for ForAllTy] in GHC.Core.Type -- rkco :: <*> -- Wanted: -- ty_co_match menv' subst2 ty1 co2 lkco' rkco' diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs index 0a9d923a32..d84bcdd774 100644 --- a/compiler/GHC/Core/Utils.hs +++ b/compiler/GHC/Core/Utils.hs @@ -74,16 +74,16 @@ import VarEnv import VarSet import Name import Literal -import DataCon +import GHC.Core.DataCon import PrimOp import Id import IdInfo import PrelNames( absentErrorIdKey ) -import Type -import Predicate -import TyCoRep( TyCoBinder(..), TyBinder ) -import Coercion -import TyCon +import GHC.Core.Type as Type +import GHC.Core.Predicate +import GHC.Core.TyCo.Rep( TyCoBinder(..), TyBinder ) +import GHC.Core.Coercion +import GHC.Core.TyCon import Unique import Outputable import TysPrim diff --git a/compiler/GHC/CoreToByteCode.hs b/compiler/GHC/CoreToByteCode.hs index 7285f192ce..99a90c92e9 100644 --- a/compiler/GHC/CoreToByteCode.hs +++ b/compiler/GHC/CoreToByteCode.hs @@ -37,14 +37,14 @@ import GHC.Core.Ppr import Literal import PrimOp import GHC.Core.FVs -import Type +import GHC.Core.Type import GHC.Types.RepType -import DataCon -import TyCon +import GHC.Core.DataCon +import GHC.Core.TyCon import Util import VarSet import TysPrim -import TyCoPpr ( pprType ) +import GHC.Core.TyCo.Ppr ( pprType ) import ErrUtils import Unique import FastString diff --git a/compiler/GHC/CoreToIface.hs b/compiler/GHC/CoreToIface.hs index 3aad60b025..ee24c60bee 100644 --- a/compiler/GHC/CoreToIface.hs +++ b/compiler/GHC/CoreToIface.hs @@ -48,28 +48,28 @@ module GHC.CoreToIface import GhcPrelude import GHC.Iface.Syntax -import DataCon +import GHC.Core.DataCon import Id import IdInfo import GHC.Core -import TyCon hiding ( pprPromotionQuote ) -import CoAxiom +import GHC.Core.TyCon hiding ( pprPromotionQuote ) +import GHC.Core.Coercion.Axiom import TysPrim ( eqPrimTyCon, eqReprPrimTyCon ) import TysWiredIn ( heqTyCon ) import MkId ( noinlineIdName ) import PrelNames import Name import BasicTypes -import Type -import PatSyn +import GHC.Core.Type +import GHC.Core.PatSyn import Outputable import FastString import Util import Var import VarEnv import VarSet -import TyCoRep -import TyCoTidy ( tidyCo ) +import GHC.Core.TyCo.Rep +import GHC.Core.TyCo.Tidy ( tidyCo ) import Demand ( isTopSig ) import Cpr ( topCprSig ) @@ -345,12 +345,12 @@ toIfaceAppArgsX fr kind ty_args VisArg -> Required InvisArg -> Inferred -- It's rare for a kind to have a constraint argument, but - -- it can happen. See Note [AnonTCB InvisArg] in TyCon. + -- it can happen. See Note [AnonTCB InvisArg] in GHC.Core.TyCon. go env ty ts@(t1:ts1) | not (isEmptyTCvSubst env) = go (zapTCvSubst env) (substTy env ty) ts - -- See Note [Care with kind instantiation] in Type.hs + -- See Note [Care with kind instantiation] in GHC.Core.Type | otherwise = -- There's a kind error in the type we are trying to print diff --git a/compiler/GHC/CoreToIface.hs-boot b/compiler/GHC/CoreToIface.hs-boot index 24fb1a148b..7daa190405 100644 --- a/compiler/GHC/CoreToIface.hs-boot +++ b/compiler/GHC/CoreToIface.hs-boot @@ -1,14 +1,14 @@ module GHC.CoreToIface where -import {-# SOURCE #-} TyCoRep ( Type, TyLit, Coercion ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, TyLit, Coercion ) import {-# SOURCE #-} GHC.Iface.Type( IfaceType, IfaceTyCon, IfaceForAllBndr , IfaceCoercion, IfaceTyLit, IfaceAppArgs ) import Var ( TyCoVarBinder ) import VarEnv ( TidyEnv ) -import TyCon ( TyCon ) +import GHC.Core.TyCon ( TyCon ) import VarSet( VarSet ) --- For TyCoRep +-- For GHC.Core.TyCo.Rep toIfaceTypeX :: VarSet -> Type -> IfaceType toIfaceTyLit :: TyLit -> IfaceTyLit toIfaceForAllBndr :: TyCoVarBinder -> IfaceForAllBndr diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs index 55771b30a9..786792ea0f 100644 --- a/compiler/GHC/CoreToStg.hs +++ b/compiler/GHC/CoreToStg.hs @@ -23,13 +23,13 @@ import GHC.Core.Utils ( exprType, findDefault, isJoinBind import GHC.Core.Arity ( manifestArity ) import GHC.Stg.Syntax -import Type +import GHC.Core.Type import GHC.Types.RepType -import TyCon +import GHC.Core.TyCon import MkId ( coercionTokenId ) import Id import IdInfo -import DataCon +import GHC.Core.DataCon import CostCentre import VarEnv import Module @@ -449,7 +449,7 @@ coreToStgExpr e0@(Case scrut bndr _ alts) = do vars_alt (con, binders, rhs) | DataAlt c <- con, c == unboxedUnitDataCon = -- This case is a bit smelly. - -- See Note [Nullary unboxed tuple] in Type.hs + -- See Note [Nullary unboxed tuple] in GHC.Core.Type -- where a nullary tuple is mapped to (State# World#) ASSERT( null binders ) do { rhs2 <- coreToStgExpr rhs diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index 859892cfbe..3ec35595e0 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -31,11 +31,11 @@ import CoreMonad ( CoreToDo(..) ) import GHC.Core.Lint ( endPassIO ) import GHC.Core import GHC.Core.Make hiding( FloatBind(..) ) -- We use our own FloatBind here -import Type +import GHC.Core.Type import Literal -import Coercion +import GHC.Core.Coercion import TcEnv -import TyCon +import GHC.Core.TyCon import Demand import Var import VarSet @@ -43,7 +43,7 @@ import VarEnv import Id import IdInfo import TysWiredIn -import DataCon +import GHC.Core.DataCon import BasicTypes import Module import UniqSupply diff --git a/compiler/GHC/Driver/Hooks.hs b/compiler/GHC/Driver/Hooks.hs index 81552a46f6..0fbb10bb89 100644 --- a/compiler/GHC/Driver/Hooks.hs +++ b/compiler/GHC/Driver/Hooks.hs @@ -45,11 +45,11 @@ import Id import GHC.Core import GHCi.RemoteTypes import SrcLoc -import Type +import GHC.Core.Type import System.Process import BasicTypes import Module -import TyCon +import GHC.Core.TyCon import CostCentre import GHC.Stg.Syntax import Stream diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 844baedce4..ed47655982 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -94,11 +94,11 @@ import GHCi.RemoteTypes ( ForeignHValue ) import GHC.CoreToByteCode ( byteCodeGen, coreExprToBCOs ) import GHC.Runtime.Linker import GHC.Core.Op.Tidy ( tidyExpr ) -import Type ( Type, Kind ) +import GHC.Core.Type ( Type, Kind ) import GHC.Core.Lint ( lintInteractiveExpr ) import VarEnv ( emptyTidyEnv ) import Panic -import ConLike +import GHC.Core.ConLike import ApiAnnotation import Module @@ -131,7 +131,7 @@ import GHC.Stg.Pipeline ( stg2stg ) import qualified GHC.StgToCmm as StgToCmm ( codeGen ) import CostCentre import ProfInit -import TyCon +import GHC.Core.TyCon import Name import NameSet import GHC.Cmm @@ -140,8 +140,8 @@ import GHC.Cmm.Info.Build import GHC.Cmm.Pipeline import GHC.Cmm.Info import GHC.Driver.CodeOutput -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import Fingerprint ( Fingerprint ) import GHC.Driver.Hooks import TcEnv diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index e879133467..b9a32d340d 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -2140,7 +2140,7 @@ joinObjectFiles dflags o_files output_fn = do SysTools.Option "-nostdlib", SysTools.Option "-Wl,-r" ] - -- See Note [No PIE while linking] in DynFlags + -- See Note [No PIE while linking] in GHC.Driver.Session ++ (if toolSettings_ccSupportsNoPie toolSettings' then [SysTools.Option "-no-pie"] else []) diff --git a/compiler/GHC/Driver/Types.hs b/compiler/GHC/Driver/Types.hs index 33a431a8f5..c2699f23e9 100644 --- a/compiler/GHC/Driver/Types.hs +++ b/compiler/GHC/Driver/Types.hs @@ -164,8 +164,8 @@ import GHC.Hs import RdrName import Avail import Module -import InstEnv ( InstEnv, ClsInst, identicalClsInstHead ) -import FamInstEnv +import GHC.Core.InstEnv ( InstEnv, ClsInst, identicalClsInstHead ) +import GHC.Core.FamInstEnv import GHC.Core ( CoreProgram, RuleBase, CoreRule ) import Name import NameEnv @@ -173,24 +173,25 @@ import VarSet import Var import Id import IdInfo ( IdDetails(..), RecSelParent(..)) -import Type +import GHC.Core.Type import ApiAnnotation ( ApiAnns ) import Annotations ( Annotation, AnnEnv, mkAnnEnv, plusAnnEnv ) -import Class -import TyCon -import CoAxiom -import ConLike -import DataCon -import PatSyn +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.PatSyn import PrelNames ( gHC_PRIM, ioTyConName, printName, mkInteractiveModule ) import TysWiredIn import GHC.Driver.Packages hiding ( Version(..) ) import GHC.Driver.CmdLine import GHC.Driver.Session -import GHC.Runtime.Linker.Types ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) ) -import GHC.Driver.Phases ( Phase, HscSource(..), hscSourceString - , isHsBootOrSig, isHsigFile ) +import GHC.Runtime.Linker.Types ( DynLinker, Linkable(..), Unlinked(..), SptEntry(..) ) +import GHC.Driver.Phases + ( Phase, HscSource(..), hscSourceString + , isHsBootOrSig, isHsigFile ) import qualified GHC.Driver.Phases as Phase import BasicTypes import GHC.Iface.Syntax diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs index 3c815821f5..70da7903fc 100644 --- a/compiler/GHC/Hs/Binds.hs +++ b/compiler/GHC/Hs/Binds.hs @@ -34,7 +34,7 @@ import GHC.Hs.Extension import GHC.Hs.Types import GHC.Core import TcEvidence -import Type +import GHC.Core.Type import NameSet import BasicTypes import Outputable diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs index b09e0d9eea..84a9bb4dca 100644 --- a/compiler/GHC/Hs/Decls.hs +++ b/compiler/GHC/Hs/Decls.hs @@ -103,19 +103,19 @@ import {-# SOURCE #-} GHC.Hs.Expr( HsExpr, HsSplice, pprExpr, import GHC.Hs.Binds import GHC.Hs.Types import GHC.Hs.Doc -import TyCon +import GHC.Core.TyCon import BasicTypes -import Coercion +import GHC.Core.Coercion import ForeignCall import GHC.Hs.Extension import NameSet -- others: -import Class +import GHC.Core.Class import Outputable import Util import SrcLoc -import Type +import GHC.Core.Type import Bag import Maybes @@ -447,7 +447,7 @@ Default methods - If there is a default method name at all, it's recorded in the ClassOpSig (in GHC.Hs.Binds), in the DefMethInfo field. - (DefMethInfo is defined in Class.hs) + (DefMethInfo is defined in GHC.Core.Class) Source-code class decls and interface-code class decls are treated subtly differently, which has given me a great deal of confusion over the years. @@ -631,7 +631,7 @@ The idea is that the associated type is really a top-level decl in its own right. However we are careful to use the same name 'a', so that we can match things up. -c.f. Note [Associated type tyvar names] in Class.hs +c.f. Note [Associated type tyvar names] in GHC.Core.Class Note [Family instance declaration binders] -} @@ -1057,7 +1057,7 @@ other argument: Here injectivity annotation would consist of two comma-separated injectivity conditions. -See also Note [Injective type families] in TyCon +See also Note [Injective type families] in GHC.Core.TyCon -} -- | Located type Family Result Signature diff --git a/compiler/GHC/Hs/Dump.hs b/compiler/GHC/Hs/Dump.hs index 5bdfc8668e..71a951a30a 100644 --- a/compiler/GHC/Hs/Dump.hs +++ b/compiler/GHC/Hs/Dump.hs @@ -23,7 +23,7 @@ import BasicTypes import FastString import NameSet import Name -import DataCon +import GHC.Core.DataCon import SrcLoc import GHC.Hs import OccName hiding (occName) diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 724087eb96..551401be6c 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -41,12 +41,12 @@ import GHC.Core import Name import NameSet import BasicTypes -import ConLike +import GHC.Core.ConLike import SrcLoc import Util import Outputable import FastString -import Type +import GHC.Core.Type import TysWiredIn (mkTupleStr) import TcType (TcType) import {-# SOURCE #-} TcRnTypes (TcLclEnv) diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs index dac9f4de93..fa538f3089 100644 --- a/compiler/GHC/Hs/Lit.hs +++ b/compiler/GHC/Hs/Lit.hs @@ -25,7 +25,7 @@ import {-# SOURCE #-} GHC.Hs.Expr( HsExpr, pprExpr ) import BasicTypes ( IntegralLit(..),FractionalLit(..),negateIntegralLit, negateFractionalLit,SourceText(..),pprWithSourceText, PprPrec(..), topPrec ) -import Type +import GHC.Core.Type import Outputable import FastString import GHC.Hs.Extension diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs index 76735b2f97..c427d977ed 100644 --- a/compiler/GHC/Hs/Pat.hs +++ b/compiler/GHC/Hs/Pat.hs @@ -61,11 +61,11 @@ import GHC.Core.Ppr ( {- instance OutputableBndr TyVar -} ) import TysWiredIn import Var import RdrName ( RdrName ) -import ConLike -import DataCon -import TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.TyCon import Outputable -import Type +import GHC.Core.Type import SrcLoc import Bag -- collect ev vars from pats import Maybes diff --git a/compiler/GHC/Hs/Types.hs b/compiler/GHC/Hs/Types.hs index d25e25b209..354611836c 100644 --- a/compiler/GHC/Hs/Types.hs +++ b/compiler/GHC/Hs/Types.hs @@ -81,10 +81,10 @@ import GHC.Hs.Extension import Id ( Id ) import Name( Name, NamedThing(getName) ) import RdrName ( RdrName ) -import DataCon( HsSrcBang(..), HsImplBang(..), - SrcStrictness(..), SrcUnpackedness(..) ) +import GHC.Core.DataCon( HsSrcBang(..), HsImplBang(..), + SrcStrictness(..), SrcUnpackedness(..) ) import TysWiredIn( mkTupleStr ) -import Type +import GHC.Core.Type import GHC.Hs.Doc import BasicTypes import SrcLoc diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs index b1bdb089cf..b3a327c4c6 100644 --- a/compiler/GHC/Hs/Utils.hs +++ b/compiler/GHC/Hs/Utils.hs @@ -112,12 +112,12 @@ import GHC.Hs.Extension import TcEvidence import RdrName import Var -import TyCoRep -import Type ( appTyArgFlags, splitAppTys, tyConArgFlags, tyConAppNeedsKindSig ) +import GHC.Core.TyCo.Rep +import GHC.Core.Type ( appTyArgFlags, splitAppTys, tyConArgFlags, tyConAppNeedsKindSig ) import TysWiredIn ( unitTy ) import TcType -import DataCon -import ConLike +import GHC.Core.DataCon +import GHC.Core.ConLike import Id import Name import NameSet hiding ( unitFV ) diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs index d467e559cd..e006b20de6 100644 --- a/compiler/GHC/HsToCore.hs +++ b/compiler/GHC/HsToCore.hs @@ -30,8 +30,8 @@ import TcRnDriver ( runTcInteractive ) import Id import IdInfo import Name -import Type -import TyCon ( tyConDataCons ) +import GHC.Core.Type +import GHC.Core.TyCon ( tyConDataCons ) import Avail import GHC.Core import GHC.Core.FVs ( exprsSomeFreeVarsList ) @@ -45,9 +45,9 @@ import GHC.HsToCore.Binds import GHC.HsToCore.Foreign.Decl import PrelNames import TysPrim -import Coercion +import GHC.Core.Coercion import TysWiredIn -import DataCon ( dataConWrapId ) +import GHC.Core.DataCon ( dataConWrapId ) import GHC.Core.Make import Module import NameSet diff --git a/compiler/GHC/HsToCore/Arrows.hs b/compiler/GHC/HsToCore/Arrows.hs index 24a7f89fb1..27502bfda4 100644 --- a/compiler/GHC/HsToCore/Arrows.hs +++ b/compiler/GHC/HsToCore/Arrows.hs @@ -37,7 +37,7 @@ import {-# SOURCE #-} GHC.HsToCore.Expr ( dsExpr, dsLExpr, dsLExprNoLP, dsLocalB dsSyntaxExpr ) import TcType -import Type ( splitPiTy ) +import GHC.Core.Type( splitPiTy ) import TcEvidence import GHC.Core import GHC.Core.FVs @@ -46,7 +46,7 @@ import GHC.Core.Make import GHC.HsToCore.Binds (dsHsWrapper) import Id -import ConLike +import GHC.Core.ConLike import TysWiredIn import BasicTypes import PrelNames diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs index 9c65603d53..950cabed37 100644 --- a/compiler/GHC/HsToCore/Binds.hs +++ b/compiler/GHC/HsToCore/Binds.hs @@ -45,14 +45,14 @@ import GHC.Core.Arity ( etaExpand ) import GHC.Core.Unfold import GHC.Core.FVs import Digraph -import Predicate +import GHC.Core.Predicate import PrelNames -import TyCon +import GHC.Core.TyCon import TcEvidence import TcType -import Type -import Coercion +import GHC.Core.Type +import GHC.Core.Coercion import TysWiredIn ( typeNatKind, typeSymbolKind ) import Id import MkId(proxyHashId) diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs index 575bb51105..7bb1886bff 100644 --- a/compiler/GHC/HsToCore/Coverage.hs +++ b/compiler/GHC/HsToCore/Coverage.hs @@ -19,12 +19,12 @@ import GHCi.RemoteTypes import Data.Array import GHC.ByteCode.Types import GHC.Stack.CCS -import Type +import GHC.Core.Type import GHC.Hs import Module import Outputable import GHC.Driver.Session -import ConLike +import GHC.Core.ConLike import Control.Monad import SrcLoc import ErrUtils @@ -39,7 +39,7 @@ import VarSet import Data.List import FastString import GHC.Driver.Types -import TyCon +import GHC.Core.TyCon import BasicTypes import MonadUtils import Maybes diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs index 36ab7eee9d..24dbe364b2 100644 --- a/compiler/GHC/HsToCore/Expr.hs +++ b/compiler/GHC/HsToCore/Expr.hs @@ -35,7 +35,7 @@ import GHC.HsToCore.Monad import GHC.HsToCore.PmCheck ( checkGuardMatches ) import Name import NameEnv -import FamInstEnv( topNormaliseType ) +import GHC.Core.FamInstEnv( topNormaliseType ) import GHC.HsToCore.Quote import GHC.Hs @@ -44,7 +44,7 @@ import GHC.Hs import TcType import TcEvidence import TcRnMonad -import Type +import GHC.Core.Type import GHC.Core import GHC.Core.Utils import GHC.Core.Make @@ -54,9 +54,9 @@ import CostCentre import Id import MkId import Module -import ConLike -import DataCon -import TyCoPpr( pprWithTYPE ) +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.TyCo.Ppr( pprWithTYPE ) import TysWiredIn import PrelNames import BasicTypes @@ -66,7 +66,7 @@ import SrcLoc import Util import Bag import Outputable -import PatSyn +import GHC.Core.PatSyn import Control.Monad import Data.List.NonEmpty ( nonEmpty ) @@ -673,7 +673,7 @@ dsExpr expr@(RecordUpd { rupd_expr = record_expr, rupd_flds = fields -- Be sure to use user_tvs (which may be ordered -- differently than `univ_tvs ++ ex_tvs) above. -- See Note [DataCon user type variable binders] - -- in DataCon. + -- in GHC.Core.DataCon. rhs = foldl' (\a b -> nlHsApp a b) inst_con val_args -- Tediously wrap the application in a cast diff --git a/compiler/GHC/HsToCore/Foreign/Call.hs b/compiler/GHC/HsToCore/Foreign/Call.hs index 72b3d996f0..705101caf3 100644 --- a/compiler/GHC/HsToCore/Foreign/Call.hs +++ b/compiler/GHC/HsToCore/Foreign/Call.hs @@ -31,16 +31,16 @@ import GHC.Core.Utils import GHC.Core.Make import MkId import ForeignCall -import DataCon +import GHC.Core.DataCon import GHC.HsToCore.Utils import TcType -import Type +import GHC.Core.Type import Id ( Id ) -import Coercion +import GHC.Core.Coercion import PrimOp import TysPrim -import TyCon +import GHC.Core.TyCon import TysWiredIn import BasicTypes import Literal diff --git a/compiler/GHC/HsToCore/Foreign/Decl.hs b/compiler/GHC/HsToCore/Foreign/Decl.hs index 686380ee39..e7f49191cf 100644 --- a/compiler/GHC/HsToCore/Foreign/Decl.hs +++ b/compiler/GHC/HsToCore/Foreign/Decl.hs @@ -26,16 +26,16 @@ import GHC.HsToCore.Foreign.Call import GHC.HsToCore.Monad import GHC.Hs -import DataCon +import GHC.Core.DataCon import GHC.Core.Unfold import Id import Literal import Module import Name -import Type +import GHC.Core.Type import GHC.Types.RepType -import TyCon -import Coercion +import GHC.Core.TyCon +import GHC.Core.Coercion import TcEnv import TcType diff --git a/compiler/GHC/HsToCore/GuardedRHSs.hs b/compiler/GHC/HsToCore/GuardedRHSs.hs index 8a1637afbc..49beaf1da4 100644 --- a/compiler/GHC/HsToCore/GuardedRHSs.hs +++ b/compiler/GHC/HsToCore/GuardedRHSs.hs @@ -26,7 +26,7 @@ import GHC.Core.Utils (bindNonRec) import GHC.HsToCore.Monad import GHC.HsToCore.Utils import GHC.HsToCore.PmCheck.Types ( Deltas, initDeltas ) -import Type ( Type ) +import GHC.Core.Type ( Type ) import Util import SrcLoc import Outputable diff --git a/compiler/GHC/HsToCore/ListComp.hs b/compiler/GHC/HsToCore/ListComp.hs index 281795c8ac..1259780573 100644 --- a/compiler/GHC/HsToCore/ListComp.hs +++ b/compiler/GHC/HsToCore/ListComp.hs @@ -29,7 +29,7 @@ import GHC.HsToCore.Utils import GHC.Driver.Session import GHC.Core.Utils import Id -import Type +import GHC.Core.Type import TysWiredIn import GHC.HsToCore.Match import PrelNames diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs index 78329e5493..f456323ccb 100644 --- a/compiler/GHC/HsToCore/Match.hs +++ b/compiler/GHC/HsToCore/Match.hs @@ -43,14 +43,14 @@ import GHC.HsToCore.Binds import GHC.HsToCore.GuardedRHSs import GHC.HsToCore.Utils import Id -import ConLike -import DataCon -import PatSyn +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.PatSyn import GHC.HsToCore.Match.Constructor import GHC.HsToCore.Match.Literal -import Type -import Coercion ( eqCoercion ) -import TyCon( isNewTyCon ) +import GHC.Core.Type +import GHC.Core.Coercion ( eqCoercion ) +import GHC.Core.TyCon ( isNewTyCon ) import TysWiredIn import SrcLoc import Maybes diff --git a/compiler/GHC/HsToCore/Match/Constructor.hs b/compiler/GHC/HsToCore/Match/Constructor.hs index 3785fde948..cae2dababd 100644 --- a/compiler/GHC/HsToCore/Match/Constructor.hs +++ b/compiler/GHC/HsToCore/Match/Constructor.hs @@ -22,7 +22,7 @@ import {-# SOURCE #-} GHC.HsToCore.Match ( match ) import GHC.Hs import GHC.HsToCore.Binds -import ConLike +import GHC.Core.ConLike import BasicTypes ( Origin(..) ) import TcType import GHC.HsToCore.Monad diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs index 6c3a2d7a7e..c25785d064 100644 --- a/compiler/GHC/HsToCore/Match/Literal.hs +++ b/compiler/GHC/HsToCore/Match/Literal.hs @@ -36,12 +36,12 @@ import GHC.Hs import Id import GHC.Core import GHC.Core.Make -import TyCon -import DataCon +import GHC.Core.TyCon +import GHC.Core.DataCon import TcHsSyn ( shortCutLit ) import TcType import Name -import Type +import GHC.Core.Type import PrelNames import TysWiredIn import TysPrim diff --git a/compiler/GHC/HsToCore/Monad.hs b/compiler/GHC/HsToCore/Monad.hs index 4893d13bb1..bded17de2f 100644 --- a/compiler/GHC/HsToCore/Monad.hs +++ b/compiler/GHC/HsToCore/Monad.hs @@ -55,7 +55,7 @@ module GHC.HsToCore.Monad ( import GhcPrelude import TcRnMonad -import FamInstEnv +import GHC.Core.FamInstEnv import GHC.Core import GHC.Core.Make ( unitExpr ) import GHC.Core.Utils ( exprType, isExprLevPoly ) @@ -67,15 +67,15 @@ import RdrName import GHC.Driver.Types import Bag import BasicTypes ( Origin ) -import DataCon -import ConLike -import TyCon +import GHC.Core.DataCon +import GHC.Core.ConLike +import GHC.Core.TyCon import GHC.HsToCore.PmCheck.Types import Id import Module import Outputable import SrcLoc -import Type +import GHC.Core.Type import UniqSupply import Name import NameEnv diff --git a/compiler/GHC/HsToCore/PmCheck.hs b/compiler/GHC/HsToCore/PmCheck.hs index efe9a80871..3891be649d 100644 --- a/compiler/GHC/HsToCore/PmCheck.hs +++ b/compiler/GHC/HsToCore/PmCheck.hs @@ -34,17 +34,17 @@ import GHC.Driver.Session import GHC.Hs import TcHsSyn import Id -import ConLike +import GHC.Core.ConLike import Name import FamInst import TysWiredIn import SrcLoc import Util import Outputable -import DataCon -import TyCon +import GHC.Core.DataCon +import GHC.Core.TyCon import Var (EvVar) -import Coercion +import GHC.Core.Coercion import TcEvidence import TcType (evVarPred) import {-# SOURCE #-} GHC.HsToCore.Expr (dsExpr, dsLExpr, dsSyntaxExpr) @@ -54,8 +54,8 @@ import GHC.HsToCore.Match.Literal (dsLit, dsOverLit) import GHC.HsToCore.Monad import Bag import OrdList -import TyCoRep -import Type +import GHC.Core.TyCo.Rep +import GHC.Core.Type import GHC.HsToCore.Utils (isTrueLHsExpr) import Maybes import qualified GHC.LanguageExtensions as LangExt @@ -539,7 +539,7 @@ translatePat fam_insts x pat = case pat of SumPat _ty p alt arity -> do (y, grds) <- translateLPatV fam_insts p let sum_con = sumDataCon alt arity - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon pure $ vanillaConGrd x sum_con [y] : grds -- -------------------------------------------------------------------------- diff --git a/compiler/GHC/HsToCore/PmCheck/Oracle.hs b/compiler/GHC/HsToCore/PmCheck/Oracle.hs index e278de4823..5d47b9f3be 100644 --- a/compiler/GHC/HsToCore/PmCheck/Oracle.hs +++ b/compiler/GHC/HsToCore/PmCheck/Oracle.hs @@ -53,22 +53,22 @@ import FastString import SrcLoc import ListSetOps (unionLists) import Maybes -import ConLike -import DataCon -import PatSyn -import TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.PatSyn +import GHC.Core.TyCon import TysWiredIn import TysPrim (tYPETyCon) -import TyCoRep -import Type -import TcSimplify (tcNormalise, tcCheckSatisfiability) -import Unify (tcMatchTy) -import TcRnTypes (completeMatchConLikes) -import Coercion +import GHC.Core.TyCo.Rep +import GHC.Core.Type +import TcSimplify (tcNormalise, tcCheckSatisfiability) +import GHC.Core.Unify (tcMatchTy) +import TcRnTypes (completeMatchConLikes) +import GHC.Core.Coercion import MonadUtils hiding (foldlM) import GHC.HsToCore.Monad hiding (foldlM) import FamInst -import FamInstEnv +import GHC.Core.FamInstEnv import Control.Monad (guard, mzero, when) import Control.Monad.Trans.Class (lift) @@ -985,7 +985,7 @@ storing required arguments along with the PmAltConLike in 'vi_neg'. -- | Guess the universal argument types of a ConLike from an instantiation of -- its result type. Rather easy for DataCons, but not so much for PatSynCons. --- See Note [Pattern synonym result type] in PatSyn.hs. +-- See Note [Pattern synonym result type] in GHC.Core.PatSyn. guessConLikeUnivTyArgsFromResTy :: FamInstEnvs -> Type -> ConLike -> Maybe [Type] guessConLikeUnivTyArgsFromResTy env res_ty (RealDataCon _) = do (tc, tc_args) <- splitTyConApp_maybe res_ty @@ -997,7 +997,7 @@ guessConLikeUnivTyArgsFromResTy env res_ty (RealDataCon _) = do guessConLikeUnivTyArgsFromResTy _ res_ty (PatSynCon ps) = do -- We are successful if we managed to instantiate *every* univ_tv of con. -- This is difficult and bound to fail in some cases, see - -- Note [Pattern synonym result type] in PatSyn.hs. So we just try our best + -- Note [Pattern synonym result type] in GHC.Core.PatSyn. So we just try our best -- here and be sure to return an instantiation when we can substitute every -- universally quantified type variable. -- We *could* instantiate all the other univ_tvs just to fresh variables, I diff --git a/compiler/GHC/HsToCore/PmCheck/Ppr.hs b/compiler/GHC/HsToCore/PmCheck/Ppr.hs index a3b5cbede4..7ea416bde9 100644 --- a/compiler/GHC/HsToCore/PmCheck/Ppr.hs +++ b/compiler/GHC/HsToCore/PmCheck/Ppr.hs @@ -16,8 +16,8 @@ import BasicTypes import Id import VarEnv import UniqDFM -import ConLike -import DataCon +import GHC.Core.ConLike +import GHC.Core.DataCon import TysWiredIn import Outputable import Control.Monad.Trans.RWS.CPS diff --git a/compiler/GHC/HsToCore/PmCheck/Types.hs b/compiler/GHC/HsToCore/PmCheck/Types.hs index 783c22738d..2f42d36370 100644 --- a/compiler/GHC/HsToCore/PmCheck/Types.hs +++ b/compiler/GHC/HsToCore/PmCheck/Types.hs @@ -46,12 +46,12 @@ import VarEnv import UniqDSet import UniqDFM import Name -import DataCon -import ConLike +import GHC.Core.DataCon +import GHC.Core.ConLike import Outputable import Maybes -import Type -import TyCon +import GHC.Core.Type +import GHC.Core.TyCon import Literal import GHC.Core import GHC.Core.Map diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs index fe06404b22..4ae93bcee8 100644 --- a/compiler/GHC/HsToCore/Quote.hs +++ b/compiler/GHC/HsToCore/Quote.hs @@ -49,7 +49,7 @@ import Name hiding( isVarOcc, isTcOcc, varName, tcName ) import THNames import NameEnv import TcType -import TyCon +import GHC.Core.TyCon import TysWiredIn import GHC.Core import GHC.Core.Make @@ -68,9 +68,9 @@ import MonadUtils import TcEvidence import Control.Monad.Trans.Reader import Control.Monad.Trans.Class -import Class +import GHC.Core.Class import GHC.Driver.Types ( MonadThings ) -import DataCon +import GHC.Core.DataCon import Var import GHC.HsToCore.Binds diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs index ce1096995a..eccd37b719 100644 --- a/compiler/GHC/HsToCore/Utils.hs +++ b/compiler/GHC/HsToCore/Utils.hs @@ -60,15 +60,15 @@ import GHC.Core.Make import MkId import Id import Literal -import TyCon -import DataCon -import PatSyn -import Type -import Coercion +import GHC.Core.TyCon +import GHC.Core.DataCon +import GHC.Core.PatSyn +import GHC.Core.Type +import GHC.Core.Coercion import TysPrim import TysWiredIn import BasicTypes -import ConLike +import GHC.Core.ConLike import UniqSet import UniqSupply import Module @@ -331,7 +331,7 @@ mkPatSynCase var ty alt fail = do alt_result = match_result} = alt (matcher, needs_void_lam) = patSynMatcher psyn - -- See Note [Matchers and builders for pattern synonyms] in PatSyns + -- See Note [Matchers and builders for pattern synonyms] in GHC.Core.PatSyn -- on these extra Void# arguments ensure_unstrict cont | needs_void_lam = Lam voidArgId cont | otherwise = cont diff --git a/compiler/GHC/Iface/Env.hs b/compiler/GHC/Iface/Env.hs index 687989f0a6..f7cea99b94 100644 --- a/compiler/GHC/Iface/Env.hs +++ b/compiler/GHC/Iface/Env.hs @@ -26,7 +26,7 @@ import GhcPrelude import TcRnMonad import GHC.Driver.Types -import Type +import GHC.Core.Type import Var import Name import Avail diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index b40454ee38..d726a15c7b 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/compiler/GHC/Iface/Ext/Ast.hs @@ -22,9 +22,9 @@ import Avail ( Avails ) import Bag ( Bag, bagToList ) import BasicTypes import BooleanFormula -import Class ( FunDep ) +import GHC.Core.Class ( FunDep ) import GHC.Core.Utils ( exprType ) -import ConLike ( conLikeName ) +import GHC.Core.ConLike ( conLikeName ) import GHC.HsToCore ( deSugarExpr ) import FieldLabel import GHC.Hs @@ -35,7 +35,7 @@ import Name ( Name, nameSrcSpan, setNameLoc ) import NameEnv ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv ) import SrcLoc import TcHsSyn ( hsLitType, hsPatType ) -import Type ( mkVisFunTys, Type ) +import GHC.Core.Type ( mkVisFunTys, Type ) import TysWiredIn ( mkListTy, mkSumTy ) import Var ( Id, Var, setVarName, varName, varType ) import TcRnTypes diff --git a/compiler/GHC/Iface/Ext/Utils.hs b/compiler/GHC/Iface/Ext/Utils.hs index 0f962c7164..2caffe56b3 100644 --- a/compiler/GHC/Iface/Ext/Utils.hs +++ b/compiler/GHC/Iface/Ext/Utils.hs @@ -14,9 +14,9 @@ import Name hiding (varName) import Outputable ( renderWithStyle, ppr, defaultUserStyle, initSDocContext ) import SrcLoc import GHC.CoreToIface -import TyCon -import TyCoRep -import Type +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.Type import Var import VarEnv diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index 829b35d0ec..7858fc6ce4 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -55,10 +55,10 @@ import PrimOp ( allThePrimOps, primOpFixity, primOpOcc ) import MkId ( seqId ) import TysPrim ( funTyConName ) import GHC.Core.Rules -import TyCon +import GHC.Core.TyCon import Annotations -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import Name import NameEnv import Avail diff --git a/compiler/GHC/Iface/Make.hs b/compiler/GHC/Iface/Make.hs index 45a7ee08e6..f903892f9a 100644 --- a/compiler/GHC/Iface/Make.hs +++ b/compiler/GHC/Iface/Make.hs @@ -32,15 +32,15 @@ import GHC.HsToCore.Usage ( mkUsageInfo, mkUsedNames, mkDependencies ) import Id import Annotations import GHC.Core -import Class -import TyCon -import CoAxiom -import ConLike -import DataCon -import Type +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.Coercion.Axiom +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.Type import TcType -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import TcRnMonad import GHC.Hs import GHC.Driver.Types @@ -416,7 +416,7 @@ coAxiomToIfaceDecl ax@(CoAxiom { co_ax_tc = tycon, co_ax_branches = branches -- 2nd parameter is the list of branch LHSs, in case of a closed type family, -- for conversion from incompatible branches to incompatible indices. -- For an open type family the list should be empty. --- See Note [Storing compatibility] in CoAxiom +-- See Note [Storing compatibility] in GHC.Core.Coercion.Axiom coAxBranchToIfaceBranch :: TyCon -> [[Type]] -> CoAxBranch -> IfaceAxBranch coAxBranchToIfaceBranch tc lhs_s (CoAxBranch { cab_tvs = tvs, cab_cvs = cvs diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs index 6028a94204..0890c6ffa0 100644 --- a/compiler/GHC/Iface/Recomp.hs +++ b/compiler/GHC/Iface/Recomp.hs @@ -1117,7 +1117,7 @@ data IfaceDeclExtras | IfaceDataExtras (Maybe Fixity) -- Fixity of the tycon itself (if it exists) [IfaceInstABI] -- Local class and family instances of this tycon - -- See Note [Orphans] in InstEnv + -- See Note [Orphans] in GHC.Core.InstEnv [AnnPayload] -- Annotations of the type itself [IfaceIdExtras] -- For each constructor: fixity, RULES and annotations @@ -1125,7 +1125,7 @@ data IfaceDeclExtras (Maybe Fixity) -- Fixity of the class itself (if it exists) [IfaceInstABI] -- Local instances of this class *or* -- of its associated data types - -- See Note [Orphans] in InstEnv + -- See Note [Orphans] in GHC.Core.InstEnv [AnnPayload] -- Annotations of the type itself [IfaceIdExtras] -- For each class method: fixity, RULES and annotations [IfExtName] -- Default methods. If a module diff --git a/compiler/GHC/Iface/Syntax.hs b/compiler/GHC/Iface/Syntax.hs index ebc88c272b..1812c34d6b 100644 --- a/compiler/GHC/Iface/Syntax.hs +++ b/compiler/GHC/Iface/Syntax.hs @@ -49,10 +49,10 @@ import BinFingerprint import GHC.Core( IsOrphan, isOrphan ) import Demand import Cpr -import Class +import GHC.Core.Class import FieldLabel import NameSet -import CoAxiom ( BranchIndex ) +import GHC.Core.Coercion.Axiom ( BranchIndex ) import Name import CostCentre import Literal @@ -66,9 +66,9 @@ import Fingerprint import Binary import BooleanFormula ( BooleanFormula, pprBooleanFormula, isTrue ) import Var( VarBndr(..), binderVar ) -import TyCon ( Role (..), Injectivity(..), tyConBndrVisArgFlag ) +import GHC.Core.TyCon ( Role (..), Injectivity(..), tyConBndrVisArgFlag ) import Util( dropList, filterByList, notNull, unzipWith, debugIsOn ) -import DataCon (SrcStrictness(..), SrcUnpackedness(..)) +import GHC.Core.DataCon (SrcStrictness(..), SrcUnpackedness(..)) import Lexeme (isLexSym) import TysWiredIn ( constraintKindTyConName ) import Util (seqList) @@ -222,7 +222,7 @@ data IfaceAxBranch = IfaceAxBranch { ifaxbTyVars :: [IfaceTvBndr] , ifaxbRoles :: [Role] , ifaxbRHS :: IfaceType , ifaxbIncomps :: [BranchIndex] } - -- See Note [Storing compatibility] in CoAxiom + -- See Note [Storing compatibility] in GHC.Core.Coercion.Axiom data IfaceConDecls = IfAbstractTyCon -- c.f TyCon.AbstractTyCon @@ -254,7 +254,7 @@ data IfaceConDecl -- set of tyvars (*not* covars) of ifConExTCvs, unioned -- with the set of ifBinders (from the parent IfaceDecl) -- whose tyvars do not appear in ifConEqSpec - -- See Note [DataCon user type variable binders] in DataCon + -- See Note [DataCon user type variable binders] in GHC.Core.DataCon ifConEqSpec :: IfaceEqSpec, -- Equality constraints ifConCtxt :: IfaceContext, -- Non-stupid context ifConArgTys :: [IfaceType], -- Arg types @@ -281,7 +281,7 @@ data IfaceClsInst ifInstTys :: [Maybe IfaceTyCon], -- the defn of ClsInst ifDFun :: IfExtName, -- The dfun ifOFlag :: OverlapFlag, -- Overlap flag - ifInstOrph :: IsOrphan } -- See Note [Orphans] in InstEnv + ifInstOrph :: IsOrphan } -- See Note [Orphans] in GHC.Core.InstEnv -- There's always a separate IfaceDecl for the DFun, which gives -- its IdInfo with its full type and version number. -- The instance declarations taken together have a version number, @@ -1200,7 +1200,7 @@ pprIfaceConDecl ss gadt_style tycon tc_binders parent -- 3. Pretty-print the data type constructor applied to its arguments. -- This process will omit any invisible arguments, such as coercion -- variables, if necessary. (See Note - -- [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep.) + -- [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep.) ppr_tc_app gadt_subst = pprPrefixIfDeclBndr how_much (occName tycon) <+> pprParendIfaceAppArgs diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs index c305f60dd3..0472dee50b 100644 --- a/compiler/GHC/Iface/Tidy.hs +++ b/compiler/GHC/Iface/Tidy.hs @@ -27,8 +27,8 @@ import GHC.Core.Stats (coreBindsStats, CoreStats(..)) import GHC.Core.Seq (seqBinds) import GHC.Core.Lint import GHC.Core.Rules -import PatSyn -import ConLike +import GHC.Core.PatSyn +import GHC.Core.ConLike import GHC.Core.Arity ( exprArity, exprBotStrictness_maybe ) import StaticPtrTable import VarEnv @@ -37,8 +37,8 @@ import Var import Id import MkId ( mkDictSelRhs ) import IdInfo -import InstEnv -import Type ( tidyTopType ) +import GHC.Core.InstEnv +import GHC.Core.Type ( tidyTopType ) import Demand ( appIsBottom, isTopSig, isBottomingSig ) import Cpr ( mkCprSig, botCpr ) import BasicTypes @@ -49,9 +49,9 @@ import Avail import GHC.Iface.Env import TcEnv import TcRnMonad -import DataCon -import TyCon -import Class +import GHC.Core.DataCon +import GHC.Core.TyCon +import GHC.Core.Class import Module import GHC.Driver.Types import Maybes @@ -1349,7 +1349,7 @@ mustExposeTyCon no_trim_types exports tc | null data_cons -- Ditto if there are no data constructors = True -- (NB: empty data types do not count as enumerations - -- see Note [Enumeration types] in TyCon + -- see Note [Enumeration types] in GHC.Core.TyCon | any exported_con data_cons -- Expose rep if any datacon or field is exported = True diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs index 0ff9235d12..8b154248ab 100644 --- a/compiler/GHC/Iface/Type.hs +++ b/compiler/GHC/Iface/Type.hs @@ -64,10 +64,10 @@ import GhcPrelude import {-# SOURCE #-} TysWiredIn ( coercibleTyCon, heqTyCon , liftedRepDataConTyCon, tupleTyConName ) -import {-# SOURCE #-} Type ( isRuntimeRepTy ) +import {-# SOURCE #-} GHC.Core.Type ( isRuntimeRepTy ) -import TyCon hiding ( pprPromotionQuote ) -import CoAxiom +import GHC.Core.TyCon hiding ( pprPromotionQuote ) +import GHC.Core.Coercion.Axiom import Var import PrelNames import Name @@ -567,7 +567,7 @@ stripInvisArgs (PrintExplicitKinds False) tys = suppress_invis tys -- Keep recursing through the remainder of the arguments, as it's -- possible that there are remaining invisible ones. -- See the "In type declarations" section of Note [VarBndrs, - -- TyCoVarBinders, TyConBinders, and visibility] in TyCoRep. + -- TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep. | otherwise -> suppress_invis ts @@ -675,7 +675,7 @@ kind application syntax to distinguish the two cases: Here, @{k} indicates that `k` is an inferred argument, and @k indicates that `k` is a specified argument. (See -Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep for +Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep for a lengthier explanation on what "inferred" and "specified" mean.) ************************************************************************ @@ -776,7 +776,7 @@ pprIfaceTyConBinders suppress_sig = sep . map go case vis of AnonTCB VisArg -> ppr_bndr (UseBndrParens True) AnonTCB InvisArg -> char '@' <> braces (ppr_bndr (UseBndrParens False)) - -- The above case is rare. (See Note [AnonTCB InvisArg] in TyCon.) + -- The above case is rare. (See Note [AnonTCB InvisArg] in GHC.Core.TyCon.) -- Should we print these differently? NamedTCB Required -> ppr_bndr (UseBndrParens True) NamedTCB Specified -> char '@' <> ppr_bndr (UseBndrParens True) @@ -967,7 +967,7 @@ defaultRuntimeRepVars ty = go False emptyFsEnv ty go in_kind _ ty@(IfaceFreeTyVar tv) -- See Note [Defaulting RuntimeRep variables], about free vars - | in_kind && Type.isRuntimeRepTy (tyVarKind tv) + | in_kind && GHC.Core.Type.isRuntimeRepTy (tyVarKind tv) = IfaceTyConApp liftedRep IA_Nil | otherwise = ty @@ -1175,7 +1175,7 @@ criteria are met: utterly misleading. See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] - in TyCoRep. + in GHC.Core.TyCo.Rep. N.B. Until now (Aug 2018) we didn't check anything for coercion variables. @@ -1252,7 +1252,7 @@ pprSpaceIfPromotedTyCon (IfaceTyConApp tyCon _) pprSpaceIfPromotedTyCon _ = id --- See equivalent function in TyCoRep.hs +-- See equivalent function in GHC.Core.TyCo.Rep.hs pprIfaceTyList :: PprPrec -> IfaceType -> IfaceType -> SDoc -- Given a type-level list (t1 ': t2), see if we can print -- it in list notation [t1, ...]. @@ -1462,7 +1462,7 @@ ppr_iface_tc_app pp ctxt_prec tc tys pprSum :: Arity -> PromotionFlag -> IfaceAppArgs -> SDoc pprSum _arity is_promoted args = -- drop the RuntimeRep vars. - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon let tys = appArgsIfaceTypes args args' = drop (length tys `div` 2) tys in pprPromotionQuoteI is_promoted @@ -1489,7 +1489,7 @@ pprTuple ctxt_prec sort promoted args = | otherwise -> -- drop the RuntimeRep vars. - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon let tys = appArgsIfaceTypes args args' = case sort of UnboxedTuple -> drop (length tys `div` 2) tys diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs index 1af97d1b6b..ebf3aa588d 100644 --- a/compiler/GHC/IfaceToCore.hs +++ b/compiler/GHC/IfaceToCore.hs @@ -33,15 +33,15 @@ import GHC.Iface.Env import BuildTyCl import TcRnMonad import TcType -import Type -import Coercion -import CoAxiom -import TyCoRep -- needs to build types & coercions in a knot -import TyCoSubst ( substTyCoVars ) +import GHC.Core.Type +import GHC.Core.Coercion +import GHC.Core.Coercion.Axiom +import GHC.Core.TyCo.Rep -- needs to build types & coercions in a knot +import GHC.Core.TyCo.Subst ( substTyCoVars ) import GHC.Driver.Types import Annotations -import InstEnv -import FamInstEnv +import GHC.Core.InstEnv +import GHC.Core.FamInstEnv import GHC.Core import GHC.Core.Utils import GHC.Core.Unfold @@ -50,10 +50,10 @@ import GHC.Core.Make import Id import MkId import IdInfo -import Class -import TyCon -import ConLike -import DataCon +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon import PrelNames import TysWiredIn import Literal @@ -867,7 +867,7 @@ tc_ax_branch prev_branches , ifaxbRoles = roles, ifaxbIncomps = incomps }) = bindIfaceTyConBinders_AT (map (\b -> Bndr (IfaceTvBndr b) (NamedTCB Inferred)) tv_bndrs) $ \ tvs -> - -- The _AT variant is needed here; see Note [CoAxBranch type variables] in CoAxiom + -- The _AT variant is needed here; see Note [CoAxBranch type variables] in GHC.Core.Coercion.Axiom bindIfaceIds cv_bndrs $ \ cvs -> do { tc_lhs <- tcIfaceAppArgs lhs ; tc_rhs <- tcIfaceType rhs @@ -1176,7 +1176,7 @@ tcIfaceTupleTy sort is_promoted args kind_args = map typeKind args' ; return (mkTyConApp tc (kind_args ++ args')) } } --- See Note [Unboxed tuple RuntimeRep vars] in TyCon +-- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon tcTupleTyCon :: Bool -- True <=> typechecking a *type* (vs. an expr) -> TupleSort -> Arity -- the number of args. *not* the tuple arity. diff --git a/compiler/GHC/IfaceToCore.hs-boot b/compiler/GHC/IfaceToCore.hs-boot index aea03c8d5d..32e13c80d1 100644 --- a/compiler/GHC/IfaceToCore.hs-boot +++ b/compiler/GHC/IfaceToCore.hs-boot @@ -3,10 +3,10 @@ module GHC.IfaceToCore where import GhcPrelude import GHC.Iface.Syntax ( IfaceDecl, IfaceClsInst, IfaceFamInst, IfaceRule , IfaceAnnotation, IfaceCompleteMatch ) -import TyCoRep ( TyThing ) -import TcRnTypes ( IfL ) -import InstEnv ( ClsInst ) -import FamInstEnv ( FamInst ) +import GHC.Core.TyCo.Rep ( TyThing ) +import TcRnTypes ( IfL ) +import GHC.Core.InstEnv ( ClsInst ) +import GHC.Core.FamInstEnv ( FamInst ) import GHC.Core ( CoreRule ) import GHC.Driver.Types ( CompleteMatch ) import Annotations ( Annotation ) diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs index 3de7a1b045..ee6a946cbb 100644 --- a/compiler/GHC/Plugins.hs +++ b/compiler/GHC/Plugins.hs @@ -10,11 +10,11 @@ module GHC.Plugins( module GHC.Driver.Plugins, module RdrName, module OccName, module Name, module Var, module Id, module IdInfo, - module CoreMonad, module GHC.Core, module Literal, module DataCon, + module CoreMonad, module GHC.Core, module Literal, module GHC.Core.DataCon, module GHC.Core.Utils, module GHC.Core.Make, module GHC.Core.FVs, module GHC.Core.Subst, module GHC.Core.Rules, module Annotations, module GHC.Driver.Session, module GHC.Driver.Packages, - module Module, module Type, module TyCon, module Coercion, + module Module, module GHC.Core.Type, module GHC.Core.TyCon, module GHC.Core.Coercion, module TysWiredIn, module GHC.Driver.Types, module BasicTypes, module VarSet, module VarEnv, module NameSet, module NameEnv, module UniqSet, module UniqFM, module FiniteMap, @@ -40,7 +40,7 @@ import IdInfo import CoreMonad import GHC.Core import Literal -import DataCon +import GHC.Core.DataCon import GHC.Core.Utils import GHC.Core.Make import GHC.Core.FVs @@ -57,11 +57,11 @@ import GHC.Driver.Packages -- Important GHC types import Module -import Type hiding {- conflict with GHC.Core.Subst -} +import GHC.Core.Type hiding {- conflict with GHC.Core.Subst -} ( substTy, extendTvSubst, extendTvSubstList, isInScope ) -import Coercion hiding {- conflict with GHC.Core.Subst -} +import GHC.Core.Coercion hiding {- conflict with GHC.Core.Subst -} ( substCo ) -import TyCon +import GHC.Core.TyCon import TysWiredIn import GHC.Driver.Types import BasicTypes hiding ( Version {- conflicts with Packages.Version -} ) diff --git a/compiler/GHC/Rename/Env.hs b/compiler/GHC/Rename/Env.hs index d66226579b..a860bdb53f 100644 --- a/compiler/GHC/Rename/Env.hs +++ b/compiler/GHC/Rename/Env.hs @@ -60,9 +60,9 @@ import NameSet import NameEnv import Avail import Module -import ConLike -import DataCon -import TyCon +import GHC.Core.ConLike +import GHC.Core.DataCon +import GHC.Core.TyCon import ErrUtils ( MsgDoc ) import PrelNames ( rOOT_MAIN ) import BasicTypes ( pprWarningTxtForMsg, TopLevelFlag(..), TupleSort(..) ) diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index 999389bb02..b04260e3df 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -35,7 +35,7 @@ module GHC.Rename.Names ( import GhcPrelude import GHC.Driver.Session -import TyCoPpr +import GHC.Core.TyCo.Ppr import GHC.Hs import TcEnv import GHC.Rename.Env @@ -61,8 +61,8 @@ import Util import FastString import FastStringEnv import Id -import Type -import PatSyn +import GHC.Core.Type +import GHC.Core.PatSyn import qualified GHC.LanguageExtensions as LangExt import Control.Monad diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs index 0f8041447b..34450620f0 100644 --- a/compiler/GHC/Rename/Pat.hs +++ b/compiler/GHC/Rename/Pat.hs @@ -73,7 +73,7 @@ import Outputable import SrcLoc import Literal ( inCharRange ) import TysWiredIn ( nilDataCon ) -import DataCon +import GHC.Core.DataCon import qualified GHC.LanguageExtensions as LangExt import Control.Monad ( when, ap, guard ) diff --git a/compiler/GHC/Rename/Types.hs b/compiler/GHC/Rename/Types.hs index a2d887bad0..d633ac6593 100644 --- a/compiler/GHC/Rename/Types.hs +++ b/compiler/GHC/Rename/Types.hs @@ -1462,7 +1462,7 @@ must come after any variables mentioned in their kinds. The k comes first because a depends on k, even though the k appears later than the a in the code. Thus, GHC does ScopedSort on the variables. -See Note [ScopedSort] in Type. +See Note [ScopedSort] in GHC.Core.Type. Implicitly bound variables are collected by any function which returns a FreeKiTyVars, FreeKiTyVarsWithDups, or FreeKiTyVarsNoDups, which notably diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs index 998bd974d9..45bd55b31a 100644 --- a/compiler/GHC/Rename/Utils.hs +++ b/compiler/GHC/Rename/Utils.hs @@ -43,7 +43,7 @@ import TcRnMonad import Name import NameSet import NameEnv -import DataCon +import GHC.Core.DataCon import SrcLoc import Outputable import Util diff --git a/compiler/GHC/Runtime/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs index 0b2ce71122..5ad6a2c6f0 100644 --- a/compiler/GHC/Runtime/Debugger.hs +++ b/compiler/GHC/Runtime/Debugger.hs @@ -30,7 +30,7 @@ import Name import Var hiding ( varName ) import VarSet import UniqSet -import Type +import GHC.Core.Type import GHC import Outputable import GHC.Core.Ppr.TyThing diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index 2a51656a95..6ef575490f 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -58,17 +58,17 @@ import GHC.Driver.Monad import GHC.Driver.Main import GHC.Hs import GHC.Driver.Types -import InstEnv -import GHC.Iface.Env ( newInteractiveBinder ) -import FamInstEnv ( FamInst ) -import GHC.Core.FVs ( orphNamesOfFamInst ) -import TyCon -import Type hiding( typeKind ) +import GHC.Core.InstEnv +import GHC.Iface.Env ( newInteractiveBinder ) +import GHC.Core.FamInstEnv ( FamInst ) +import GHC.Core.FVs ( orphNamesOfFamInst ) +import GHC.Core.TyCon +import GHC.Core.Type hiding( typeKind ) import GHC.Types.RepType import TcType import Constraint import TcOrigin -import Predicate +import GHC.Core.Predicate import Var import Id import Name hiding ( varName ) diff --git a/compiler/GHC/Runtime/Eval/Types.hs b/compiler/GHC/Runtime/Eval/Types.hs index 93072075c0..f1e3308f70 100644 --- a/compiler/GHC/Runtime/Eval/Types.hs +++ b/compiler/GHC/Runtime/Eval/Types.hs @@ -20,7 +20,7 @@ import Id import Name import Module import RdrName -import Type +import GHC.Core.Type import SrcLoc import Exception diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index c9905b5801..0daea2181b 100644 --- a/compiler/GHC/Runtime/Heap/Inspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -32,10 +32,10 @@ import GHCi.RemoteTypes import GHC.Driver.Types import GHCi.Message ( fromSerializableException ) -import DataCon -import Type +import GHC.Core.DataCon +import GHC.Core.Type import GHC.Types.RepType -import qualified Unify as U +import qualified GHC.Core.Unify as U import Var import TcRnMonad import TcType @@ -44,7 +44,7 @@ import TcHsSyn ( zonkTcTypeToTypeX, mkEmptyZonkEnv, ZonkFlexi( RuntimeUnkFlexi ) import TcUnify import TcEnv -import TyCon +import GHC.Core.TyCon import Name import OccName import Module @@ -833,7 +833,7 @@ extractSubTerms recurse clos = liftM thdOf3 . go 0 0 go ptr_i arr_i (ty:tys) | Just (tc, elem_tys) <- tcSplitTyConApp_maybe ty , isUnboxedTupleTyCon tc - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon = do (ptr_i, arr_i, terms0) <- go ptr_i arr_i (dropRuntimeRepArgs elem_tys) (ptr_i, arr_i, terms1) <- go ptr_i arr_i tys diff --git a/compiler/GHC/Runtime/Loader.hs b/compiler/GHC/Runtime/Loader.hs index 81c332a655..44737c48ed 100644 --- a/compiler/GHC/Runtime/Loader.hs +++ b/compiler/GHC/Runtime/Loader.hs @@ -40,9 +40,9 @@ import PrelNames ( pluginTyConName, frontendPluginTyConName ) import GHC.Driver.Types import GHCi.RemoteTypes ( HValue ) -import Type ( Type, eqType, mkTyConTy ) -import TyCoPpr ( pprTyThingCategory ) -import TyCon ( TyCon ) +import GHC.Core.Type ( Type, eqType, mkTyConTy ) +import GHC.Core.TyCo.Ppr ( pprTyThingCategory ) +import GHC.Core.TyCon ( TyCon ) import Name ( Name, nameModule_maybe ) import Id ( idType ) import Module ( Module, ModuleName ) diff --git a/compiler/GHC/Stg/CSE.hs b/compiler/GHC/Stg/CSE.hs index ec497a8a59..ea9c8e61fa 100644 --- a/compiler/GHC/Stg/CSE.hs +++ b/compiler/GHC/Stg/CSE.hs @@ -88,7 +88,7 @@ module GHC.Stg.CSE (stgCse) where import GhcPrelude -import DataCon +import GHC.Core.DataCon import Id import GHC.Stg.Syntax import Outputable diff --git a/compiler/GHC/Stg/Lift/Monad.hs b/compiler/GHC/Stg/Lift/Monad.hs index 8cc84172d2..8c0a6d27fc 100644 --- a/compiler/GHC/Stg/Lift/Monad.hs +++ b/compiler/GHC/Stg/Lift/Monad.hs @@ -34,7 +34,7 @@ import Outputable import OrdList import GHC.Stg.Subst import GHC.Stg.Syntax -import Type +import GHC.Core.Type import UniqSupply import Util import VarEnv diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs index 471bbf763e..3d06815832 100644 --- a/compiler/GHC/Stg/Lint.hs +++ b/compiler/GHC/Stg/Lint.hs @@ -47,11 +47,11 @@ import BasicTypes ( TopLevelFlag(..), isTopLevel ) import CostCentre ( isCurrentCCS ) import Id ( Id, idType, isJoinId, idName ) import VarSet -import DataCon +import GHC.Core.DataCon import GHC.Core ( AltCon(..) ) import Name ( getSrcLoc, nameIsLocalOrFrom ) import ErrUtils ( MsgDoc, Severity(..), mkLocMessage ) -import Type +import GHC.Core.Type import GHC.Types.RepType import SrcLoc import Outputable diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index 1b8381b1b7..534cdbfbcb 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -68,7 +68,7 @@ import CostCentre ( CostCentreStack ) import Data.ByteString ( ByteString ) import Data.Data ( Data ) import Data.List ( intersperse ) -import DataCon +import GHC.Core.DataCon import GHC.Driver.Session import ForeignCall ( ForeignCall ) import Id @@ -80,9 +80,9 @@ import GHC.Driver.Packages ( isDynLinkName ) import GHC.Platform import GHC.Core.Ppr( {- instances -} ) import PrimOp ( PrimOp, PrimCall ) -import TyCon ( PrimRep(..), TyCon ) -import Type ( Type ) -import GHC.Types.RepType ( typePrimRep1 ) +import GHC.Core.TyCon ( PrimRep(..), TyCon ) +import GHC.Core.Type ( Type ) +import GHC.Types.RepType ( typePrimRep1 ) import Util import Data.List.NonEmpty ( NonEmpty, toList ) diff --git a/compiler/GHC/Stg/Unarise.hs b/compiler/GHC/Stg/Unarise.hs index cf47d204af..98738470b2 100644 --- a/compiler/GHC/Stg/Unarise.hs +++ b/compiler/GHC/Stg/Unarise.hs @@ -204,7 +204,7 @@ import GhcPrelude import BasicTypes import GHC.Core -import DataCon +import GHC.Core.DataCon import FastString (FastString, mkFastString) import Id import Literal @@ -214,7 +214,7 @@ import MonadUtils (mapAccumLM) import Outputable import GHC.Types.RepType import GHC.Stg.Syntax -import Type +import GHC.Core.Type import TysPrim (intPrimTy,wordPrimTy,word64PrimTy) import TysWiredIn import UniqSupply diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs index e5aaf7f5b6..1100cf4705 100644 --- a/compiler/GHC/StgToCmm.hs +++ b/compiler/GHC/StgToCmm.hs @@ -38,8 +38,8 @@ import CostCentre import Id import IdInfo import GHC.Types.RepType -import DataCon -import TyCon +import GHC.Core.DataCon +import GHC.Core.TyCon import Module import Outputable import Stream diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs index bd9abbfdea..26532b974d 100644 --- a/compiler/GHC/StgToCmm/ArgRep.hs +++ b/compiler/GHC/StgToCmm/ArgRep.hs @@ -19,9 +19,9 @@ import GhcPrelude import GHC.StgToCmm.Closure ( idPrimRep ) -import GHC.Runtime.Heap.Layout ( WordOff ) +import GHC.Runtime.Heap.Layout ( WordOff ) import Id ( Id ) -import TyCon ( PrimRep(..), primElemRepSizeB ) +import GHC.Core.TyCon ( PrimRep(..), primElemRepSizeB ) import BasicTypes ( RepArity ) import Constants ( wORD64_SIZE ) import GHC.Driver.Session diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs index d42a7f4764..7bb73111a9 100644 --- a/compiler/GHC/StgToCmm/Closure.hs +++ b/compiler/GHC/StgToCmm/Closure.hs @@ -76,12 +76,12 @@ import GHC.Cmm.BlockId import GHC.Cmm.CLabel import Id import IdInfo -import DataCon +import GHC.Core.DataCon import Name -import Type -import TyCoRep +import GHC.Core.Type +import GHC.Core.TyCo.Rep import TcType -import TyCon +import GHC.Core.TyCon import GHC.Types.RepType import BasicTypes import Outputable diff --git a/compiler/GHC/StgToCmm/DataCon.hs b/compiler/GHC/StgToCmm/DataCon.hs index 199417ad34..43e2ab8e9a 100644 --- a/compiler/GHC/StgToCmm/DataCon.hs +++ b/compiler/GHC/StgToCmm/DataCon.hs @@ -36,7 +36,7 @@ import GHC.Cmm.Graph import GHC.Runtime.Heap.Layout import CostCentre import Module -import DataCon +import GHC.Core.DataCon import GHC.Driver.Session import FastString import Id diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs index a0c49e69ee..fe886644c4 100644 --- a/compiler/GHC/StgToCmm/Env.hs +++ b/compiler/GHC/StgToCmm/Env.hs @@ -26,7 +26,7 @@ module GHC.StgToCmm.Env ( import GhcPrelude -import TyCon +import GHC.Core.TyCon import GHC.StgToCmm.Monad import GHC.StgToCmm.Utils import GHC.StgToCmm.Closure @@ -42,7 +42,7 @@ import GHC.Cmm.Graph import Name import Outputable import GHC.Stg.Syntax -import Type +import GHC.Core.Type import TysPrim import UniqFM import Util diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs index cf0d4be8bc..f8e2cbd73d 100644 --- a/compiler/GHC/StgToCmm/Expr.hs +++ b/compiler/GHC/StgToCmm/Expr.hs @@ -37,15 +37,15 @@ import GHC.Cmm.BlockId import GHC.Cmm hiding ( succ ) import GHC.Cmm.Info import GHC.Core -import DataCon -import GHC.Driver.Session ( mAX_PTR_TAG ) +import GHC.Core.DataCon +import GHC.Driver.Session ( mAX_PTR_TAG ) import ForeignCall import Id import PrimOp -import TyCon -import Type ( isUnliftedType ) -import GHC.Types.RepType ( isVoidTy, countConRepArgs ) -import CostCentre ( CostCentreStack, currentCCS ) +import GHC.Core.TyCon +import GHC.Core.Type ( isUnliftedType ) +import GHC.Types.RepType ( isVoidTy, countConRepArgs ) +import CostCentre ( CostCentreStack, currentCCS ) import Maybes import Util import FastString diff --git a/compiler/GHC/StgToCmm/Foreign.hs b/compiler/GHC/StgToCmm/Foreign.hs index 04b8478c0f..b083736b20 100644 --- a/compiler/GHC/StgToCmm/Foreign.hs +++ b/compiler/GHC/StgToCmm/Foreign.hs @@ -32,7 +32,7 @@ import GHC.Cmm.BlockId (newBlockId) import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.Graph -import Type +import GHC.Core.Type import GHC.Types.RepType import GHC.Cmm.CLabel import GHC.Runtime.Heap.Layout @@ -43,7 +43,7 @@ import Outputable import UniqSupply import BasicTypes -import TyCoRep +import GHC.Core.TyCo.Rep import TysPrim import Util (zipEqual) diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs index 1438077fd5..cf2024fa31 100644 --- a/compiler/GHC/StgToCmm/Layout.hs +++ b/compiler/GHC/StgToCmm/Layout.hs @@ -50,7 +50,7 @@ import GHC.Cmm.Info import GHC.Cmm.CLabel import GHC.Stg.Syntax import Id -import TyCon ( PrimRep(..), primRepSizeB ) +import GHC.Core.TyCon ( PrimRep(..), primRepSizeB ) import BasicTypes ( RepArity ) import GHC.Driver.Session import Module diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs index d9ab05eebb..2555d764db 100644 --- a/compiler/GHC/StgToCmm/Prim.hs +++ b/compiler/GHC/StgToCmm/Prim.hs @@ -43,8 +43,8 @@ import GHC.Cmm.Graph import GHC.Stg.Syntax import GHC.Cmm import Module ( rtsUnitId ) -import Type ( Type, tyConAppTyCon ) -import TyCon +import GHC.Core.Type ( Type, tyConAppTyCon ) +import GHC.Core.TyCon import GHC.Cmm.CLabel import GHC.Cmm.Utils import PrimOp diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs index 4257f02886..5968b9a944 100644 --- a/compiler/GHC/StgToCmm/Ticky.hs +++ b/compiler/GHC/StgToCmm/Ticky.hs @@ -131,8 +131,8 @@ import GHC.Driver.Session -- Turgid imports for showTypeCategory import PrelNames import TcType -import TyCon -import Predicate +import GHC.Core.TyCon +import GHC.Core.Predicate import Data.Maybe import qualified Data.Char diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs index 310bf70a7c..e576c2d95e 100644 --- a/compiler/GHC/StgToCmm/Utils.hs +++ b/compiler/GHC/StgToCmm/Utils.hs @@ -64,8 +64,8 @@ import GHC.StgToCmm.CgUtils import ForeignCall import IdInfo -import Type -import TyCon +import GHC.Core.Type +import GHC.Core.TyCon import GHC.Runtime.Heap.Layout import Module import Literal diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs index 7c9077d516..b881186799 100644 --- a/compiler/GHC/ThToHs.hs +++ b/compiler/GHC/ThToHs.hs @@ -34,8 +34,8 @@ import Module import RdrHsSyn import OccName import SrcLoc -import Type -import qualified Coercion ( Role(..) ) +import GHC.Core.Type +import qualified GHC.Core.Coercion as Coercion ( Role(..) ) import TysWiredIn import BasicTypes as Hs import ForeignCall diff --git a/compiler/GHC/Types/RepType.hs b/compiler/GHC/Types/RepType.hs index cdda659688..3a76dde256 100644 --- a/compiler/GHC/Types/RepType.hs +++ b/compiler/GHC/Types/RepType.hs @@ -26,13 +26,13 @@ module GHC.Types.RepType import GhcPrelude import BasicTypes (Arity, RepArity) -import DataCon +import GHC.Core.DataCon import Outputable import PrelNames -import Coercion -import TyCon -import TyCoRep -import Type +import GHC.Core.Coercion +import GHC.Core.TyCon +import GHC.Core.TyCo.Rep +import GHC.Core.Type import Util import TysPrim import {-# SOURCE #-} TysWiredIn ( anyTypeOfKind ) diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 9bae45365e..a954a7449b 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -651,7 +651,7 @@ hasOverlappingFlag mode = Incoherent _ -> True _ -> False -data OverlapMode -- See Note [Rules for instance lookup] in InstEnv +data OverlapMode -- See Note [Rules for instance lookup] in GHC.Core.InstEnv = NoOverlap SourceText -- See Note [Pragma source text] -- ^ This instance must not overlap another `NoOverlap` instance. @@ -703,7 +703,7 @@ data OverlapMode -- See Note [Rules for instance lookup] in InstEnv -- instance Foo [a] -- Without the Incoherent flag, we'd complain that -- instantiating 'b' would change which instance - -- was chosen. See also note [Incoherent instances] in InstEnv + -- was chosen. See also note [Incoherent instances] in GHC.Core.InstEnv deriving (Eq, Data) diff --git a/compiler/basicTypes/ConLike.hs-boot b/compiler/basicTypes/ConLike.hs-boot deleted file mode 100644 index 1badc8d562..0000000000 --- a/compiler/basicTypes/ConLike.hs-boot +++ /dev/null @@ -1,9 +0,0 @@ -module ConLike where -import {-# SOURCE #-} DataCon (DataCon) -import {-# SOURCE #-} PatSyn (PatSyn) -import Name ( Name ) - -data ConLike = RealDataCon DataCon - | PatSynCon PatSyn - -conLikeName :: ConLike -> Name diff --git a/compiler/basicTypes/Demand.hs b/compiler/basicTypes/Demand.hs index 42d690a942..26452721b2 100644 --- a/compiler/basicTypes/Demand.hs +++ b/compiler/basicTypes/Demand.hs @@ -70,9 +70,9 @@ import BasicTypes import Binary import Maybes ( orElse ) -import Type ( Type ) -import TyCon ( isNewTyCon, isClassTyCon ) -import DataCon ( splitDataProductType_maybe ) +import GHC.Core.Type ( Type ) +import GHC.Core.TyCon ( isNewTyCon, isClassTyCon ) +import GHC.Core.DataCon ( splitDataProductType_maybe ) {- ************************************************************************ diff --git a/compiler/basicTypes/Id.hs b/compiler/basicTypes/Id.hs index cc693e2f44..8eafcdee2f 100644 --- a/compiler/basicTypes/Id.hs +++ b/compiler/basicTypes/Id.hs @@ -17,10 +17,11 @@ -- -- * 'Name.Name': see "Name#name_types" -- --- * 'Id.Id' represents names that not only have a 'Name.Name' but also a 'TyCoRep.Type' and some additional --- details (a 'IdInfo.IdInfo' and one of 'Var.LocalIdDetails' or 'IdInfo.GlobalIdDetails') that --- are added, modified and inspected by various compiler passes. These 'Var.Var' names may either --- be global or local, see "Var#globalvslocal" +-- * 'Id.Id' represents names that not only have a 'Name.Name' but also a +-- 'GHC.Core.TyCo.Rep.Type' and some additional details (a 'IdInfo.IdInfo' and +-- one of 'Var.LocalIdDetails' or 'IdInfo.GlobalIdDetails') that are added, +-- modified and inspected by various compiler passes. These 'Var.Var' names +-- may either be global or local, see "Var#globalvslocal" -- -- * 'Var.Var': see "Var#name_types" @@ -134,15 +135,15 @@ import Var( Id, CoVar, JoinId, isId, isLocalId, isGlobalId, isExportedId ) import qualified Var -import Type +import GHC.Core.Type import GHC.Types.RepType import TysPrim -import DataCon +import GHC.Core.DataCon import Demand import Cpr import Name import Module -import Class +import GHC.Core.Class import {-# SOURCE #-} PrimOp (PrimOp) import ForeignCall import Maybes diff --git a/compiler/basicTypes/IdInfo.hs b/compiler/basicTypes/IdInfo.hs index ea778ca87e..dcf1740d3c 100644 --- a/compiler/basicTypes/IdInfo.hs +++ b/compiler/basicTypes/IdInfo.hs @@ -88,15 +88,15 @@ import GhcPrelude import GHC.Core -import Class +import GHC.Core.Class import {-# SOURCE #-} PrimOp (PrimOp) import Name import VarSet import BasicTypes -import DataCon -import TyCon -import PatSyn -import Type +import GHC.Core.DataCon +import GHC.Core.TyCon +import GHC.Core.PatSyn +import GHC.Core.Type import ForeignCall import Outputable import Module diff --git a/compiler/basicTypes/Literal.hs b/compiler/basicTypes/Literal.hs index 035ba3b4b9..db03f9481e 100644 --- a/compiler/basicTypes/Literal.hs +++ b/compiler/basicTypes/Literal.hs @@ -54,8 +54,8 @@ import GhcPrelude import TysPrim import PrelNames -import Type -import TyCon +import GHC.Core.Type +import GHC.Core.TyCon import Outputable import FastString import BasicTypes diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs index 499b0347e1..3b73882fb1 100644 --- a/compiler/basicTypes/MkId.hs +++ b/compiler/basicTypes/MkId.hs @@ -46,22 +46,22 @@ import GHC.Core.Rules import TysPrim import TysWiredIn import PrelRules -import Type -import TyCoRep -import FamInstEnv -import Coercion +import GHC.Core.Type +import GHC.Core.TyCo.Rep +import GHC.Core.FamInstEnv +import GHC.Core.Coercion import TcType import GHC.Core.Make import GHC.Core.Utils ( mkCast, mkDefaultCase ) import GHC.Core.Unfold import Literal -import TyCon -import Class +import GHC.Core.TyCon +import GHC.Core.Class import NameSet import Name import PrimOp import ForeignCall -import DataCon +import GHC.Core.DataCon import Id import IdInfo import Demand @@ -853,7 +853,7 @@ not. What sets them apart? The types of their constructors, which are: MkT2 :: forall b a. b -> T2 a b MkT2's use of GADT syntax allows it to permute the order in which `a` and `b` -would normally appear. See Note [DataCon user type variable binders] in DataCon +would normally appear. See Note [DataCon user type variable binders] in GHC.Core.DataCon for further discussion on this topic. The worker data cons for T1 and T2, however, both have types such that `a` is diff --git a/compiler/basicTypes/MkId.hs-boot b/compiler/basicTypes/MkId.hs-boot index 0a9ac2c5f1..46695c5b74 100644 --- a/compiler/basicTypes/MkId.hs-boot +++ b/compiler/basicTypes/MkId.hs-boot @@ -1,8 +1,8 @@ module MkId where import Name( Name ) import Var( Id ) -import Class( Class ) -import {-# SOURCE #-} DataCon( DataCon ) +import GHC.Core.Class( Class ) +import {-# SOURCE #-} GHC.Core.DataCon( DataCon ) import {-# SOURCE #-} PrimOp( PrimOp ) data DataConBoxer diff --git a/compiler/basicTypes/Name.hs b/compiler/basicTypes/Name.hs index 9741fb1957..fd868a8489 100644 --- a/compiler/basicTypes/Name.hs +++ b/compiler/basicTypes/Name.hs @@ -81,7 +81,7 @@ module Name ( import GhcPrelude -import {-# SOURCE #-} TyCoRep( TyThing ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep( TyThing ) import OccName import Module diff --git a/compiler/basicTypes/OccName.hs b/compiler/basicTypes/OccName.hs index 3a45cf87dd..56864e26cf 100644 --- a/compiler/basicTypes/OccName.hs +++ b/compiler/basicTypes/OccName.hs @@ -132,7 +132,7 @@ data NameSpace = VarName -- Variables, including "real" data constructors deriving( Eq, Ord ) -- Note [Data Constructors] --- see also: Note [Data Constructor Naming] in DataCon.hs +-- see also: Note [Data Constructor Naming] in GHC.Core.DataCon -- -- $real_vs_source_data_constructors -- There are two forms of data constructor: diff --git a/compiler/basicTypes/Var.hs b/compiler/basicTypes/Var.hs index cadbe070a4..c8dd8f11a0 100644 --- a/compiler/basicTypes/Var.hs +++ b/compiler/basicTypes/Var.hs @@ -22,8 +22,8 @@ -- * 'Id.Id': see "Id#name_types" -- -- * 'Var.Var' is a synonym for the 'Id.Id' type but it may additionally --- potentially contain type variables, which have a 'TyCoRep.Kind' --- rather than a 'TyCoRep.Type' and only contain some extra +-- potentially contain type variables, which have a 'GHC.Core.TyCo.Rep.Kind' +-- rather than a 'GHC.Core.TyCo.Rep.Type' and only contain some extra -- details during typechecking. -- -- These 'Var.Var' names may either be global or local, see "Var#globalvslocal" @@ -91,8 +91,8 @@ module Var ( import GhcPrelude -import {-# SOURCE #-} TyCoRep( Type, Kind ) -import {-# SOURCE #-} TyCoPpr( pprKind ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep( Type, Kind ) +import {-# SOURCE #-} GHC.Core.TyCo.Ppr( pprKind ) import {-# SOURCE #-} TcType( TcTyVarDetails, pprTcTyVarDetails, vanillaSkolemTv ) import {-# SOURCE #-} IdInfo( IdDetails, IdInfo, coVarDetails, isCoVarDetails, vanillaIdInfo, pprIdDetails ) @@ -387,7 +387,7 @@ updateVarTypeM f id = do { ty' <- f (varType id) -- Is something required to appear in source Haskell ('Required'), -- permitted by request ('Specified') (visible type application), or -- prohibited entirely from appearing in source Haskell ('Inferred')? --- See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep +-- See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep data ArgFlag = Inferred | Specified | Required deriving (Eq, Ord, Data) -- (<) on ArgFlag means "is less visible than" @@ -518,7 +518,7 @@ data VarBndr var argf = Bndr var argf -- -- A 'TyCoVarBinder' is the binder of a ForAllTy -- It's convenient to define this synonym here rather its natural --- home in TyCoRep, because it's used in DataCon.hs-boot +-- home in GHC.Core.TyCo.Rep, because it's used in GHC.Core.DataCon.hs-boot -- -- A 'TyVarBinder' is a binder with only TyVar type TyCoVarBinder = VarBndr TyCoVar ArgFlag diff --git a/compiler/basicTypes/Var.hs-boot b/compiler/basicTypes/Var.hs-boot index aa022eaf27..97b4d0348b 100644 --- a/compiler/basicTypes/Var.hs-boot +++ b/compiler/basicTypes/Var.hs-boot @@ -1,4 +1,3 @@ --- Var.hs-boot is Imported (only) by TyCoRep.hs-boot module Var where import GhcPrelude () diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index 7a2fd82342..2dcd462d69 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -171,7 +171,6 @@ Library specialise stranal typecheck - types utils -- we use an explicit Prelude @@ -193,9 +192,9 @@ Library Avail AsmUtils BasicTypes - ConLike - DataCon - PatSyn + GHC.Core.ConLike + GHC.Core.DataCon + GHC.Core.PatSyn Demand Cpr GHC.Cmm.DebugBlock @@ -207,7 +206,7 @@ Library GHC.Driver.Ways Id IdInfo - Predicate + GHC.Core.Predicate Lexeme Literal GHC.Llvm @@ -407,7 +406,7 @@ Library Ctype HaddockUtils Lexer - OptCoercion + GHC.Core.Coercion.Opt Parser RdrHsSyn ApiAnnotation @@ -523,22 +522,22 @@ Library TcSMonad TcTypeNats TcSplice - Class - Coercion + GHC.Core.Class + GHC.Core.Coercion GHC.HsToCore.Quote THNames - FamInstEnv + GHC.Core.FamInstEnv FunDeps - InstEnv - TyCon - CoAxiom - Type - TyCoRep - TyCoFVs - TyCoSubst - TyCoPpr - TyCoTidy - Unify + GHC.Core.InstEnv + GHC.Core.TyCon + GHC.Core.Coercion.Axiom + GHC.Core.Type + GHC.Core.TyCo.Rep + GHC.Core.TyCo.FVs + GHC.Core.TyCo.Subst + GHC.Core.TyCo.Ppr + GHC.Core.TyCo.Tidy + GHC.Core.Unify Bag Binary BooleanFormula diff --git a/compiler/iface/BuildTyCl.hs b/compiler/iface/BuildTyCl.hs index 8518b01e66..bae7398b1c 100644 --- a/compiler/iface/BuildTyCl.hs +++ b/compiler/iface/BuildTyCl.hs @@ -20,20 +20,20 @@ module BuildTyCl ( import GhcPrelude import GHC.Iface.Env -import FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom ) +import GHC.Core.FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom ) import TysWiredIn( isCTupleTyConName ) import TysPrim ( voidPrimTy ) -import DataCon -import PatSyn +import GHC.Core.DataCon +import GHC.Core.PatSyn import Var import VarSet import BasicTypes import Name import NameEnv import MkId -import Class -import TyCon -import Type +import GHC.Core.Class +import GHC.Core.TyCon +import GHC.Core.Type import Id import TcType diff --git a/compiler/main/StaticPtrTable.hs b/compiler/main/StaticPtrTable.hs index 1a87cf8d1d..cb909cc627 100644 --- a/compiler/main/StaticPtrTable.hs +++ b/compiler/main/StaticPtrTable.hs @@ -127,7 +127,7 @@ import GhcPrelude import GHC.Cmm.CLabel import GHC.Core import GHC.Core.Utils (collectMakeStaticArgs) -import DataCon +import GHC.Core.DataCon import GHC.Driver.Session import GHC.Driver.Types import Id @@ -138,7 +138,7 @@ import Outputable import GHC.Platform import PrelNames import TcEnv (lookupGlobal) -import Type +import GHC.Core.Type import Control.Monad.Trans.Class (lift) import Control.Monad.Trans.State diff --git a/compiler/main/UpdateCafInfos.hs b/compiler/main/UpdateCafInfos.hs index 46d3aee676..a1287e88c6 100644 --- a/compiler/main/UpdateCafInfos.hs +++ b/compiler/main/UpdateCafInfos.hs @@ -10,7 +10,7 @@ import GHC.Core import GHC.Driver.Types import Id import IdInfo -import InstEnv +import GHC.Core.InstEnv import NameEnv import NameSet import Util diff --git a/compiler/parser/Parser.y b/compiler/parser/Parser.y index 26c56d062b..88422f9b3f 100644 --- a/compiler/parser/Parser.y +++ b/compiler/parser/Parser.y @@ -48,8 +48,8 @@ import qualified Prelude import GHC.Hs -- compiler/main -import GHC.Driver.Phases ( HscSource(..) ) -import GHC.Driver.Types ( IsBootInterface, WarningTxt(..) ) +import GHC.Driver.Phases ( HscSource(..) ) +import GHC.Driver.Types ( IsBootInterface, WarningTxt(..) ) import GHC.Driver.Session import GHC.Driver.Backpack.Syntax import UnitInfo @@ -64,14 +64,14 @@ import Outputable -- compiler/basicTypes import RdrName import OccName ( varName, dataName, tcClsName, tvName, startsWithUnderscore ) -import DataCon ( DataCon, dataConName ) +import GHC.Core.DataCon ( DataCon, dataConName ) import SrcLoc import Module import BasicTypes -- compiler/types -import Type ( funTyCon ) -import Class ( FunDep ) +import GHC.Core.Type ( funTyCon ) +import GHC.Core.Class ( FunDep ) -- compiler/parser import RdrHsSyn diff --git a/compiler/parser/RdrHsSyn.hs b/compiler/parser/RdrHsSyn.hs index 1be2c76864..599846398b 100644 --- a/compiler/parser/RdrHsSyn.hs +++ b/compiler/parser/RdrHsSyn.hs @@ -104,16 +104,16 @@ module RdrHsSyn ( import GhcPrelude import GHC.Hs -- Lots of it -import TyCon ( TyCon, isTupleTyCon, tyConSingleDataCon_maybe ) -import DataCon ( DataCon, dataConTyCon ) -import ConLike ( ConLike(..) ) -import CoAxiom ( Role, fsFromRole ) +import GHC.Core.TyCon ( TyCon, isTupleTyCon, tyConSingleDataCon_maybe ) +import GHC.Core.DataCon ( DataCon, dataConTyCon ) +import GHC.Core.ConLike ( ConLike(..) ) +import GHC.Core.Coercion.Axiom ( Role, fsFromRole ) import RdrName import Name import BasicTypes import Lexer import Lexeme ( isLexCon ) -import Type ( TyThing(..), funTyCon ) +import GHC.Core.Type ( TyThing(..), funTyCon ) import TysWiredIn ( cTupleTyConName, tupleTyCon, tupleDataCon, nilDataConName, nilDataConKey, listTyConName, listTyConKey, eqTyCon_RDR, diff --git a/compiler/prelude/KnownUniques.hs b/compiler/prelude/KnownUniques.hs index 00085cad0b..1d292d899b 100644 --- a/compiler/prelude/KnownUniques.hs +++ b/compiler/prelude/KnownUniques.hs @@ -29,8 +29,8 @@ module KnownUniques import GhcPrelude import TysWiredIn -import TyCon -import DataCon +import GHC.Core.TyCon +import GHC.Core.DataCon import Id import BasicTypes import Outputable diff --git a/compiler/prelude/PrelInfo.hs b/compiler/prelude/PrelInfo.hs index 55ceb047a8..6ecb106efa 100644 --- a/compiler/prelude/PrelInfo.hs +++ b/compiler/prelude/PrelInfo.hs @@ -51,13 +51,13 @@ import GhcPrelude import KnownUniques import Unique ( isValidKnownKeyUnique ) -import ConLike ( ConLike(..) ) +import GHC.Core.ConLike ( ConLike(..) ) import THNames ( templateHaskellNames ) import PrelNames import PrelRules import Avail import PrimOp -import DataCon +import GHC.Core.DataCon import Id import Name import NameEnv @@ -66,8 +66,8 @@ import Outputable import TysPrim import TysWiredIn import GHC.Driver.Types -import Class -import TyCon +import GHC.Core.Class +import GHC.Core.TyCon import UniqFM import Util import TcTypeNats ( typeNatTyCons ) diff --git a/compiler/prelude/PrelRules.hs b/compiler/prelude/PrelRules.hs index 643bcae06d..9b2047d521 100644 --- a/compiler/prelude/PrelRules.hs +++ b/compiler/prelude/PrelRules.hs @@ -37,14 +37,15 @@ import GHC.Core.SimpleOpt ( exprIsLiteral_maybe ) import PrimOp ( PrimOp(..), tagToEnumKey ) import TysWiredIn import TysPrim -import TyCon ( tyConDataCons_maybe, isAlgTyCon, isEnumerationTyCon - , isNewTyCon, unwrapNewTyCon_maybe, tyConDataCons - , tyConFamilySize ) -import DataCon ( dataConTagZ, dataConTyCon, dataConWrapId, dataConWorkId ) +import GHC.Core.TyCon + ( tyConDataCons_maybe, isAlgTyCon, isEnumerationTyCon + , isNewTyCon, unwrapNewTyCon_maybe, tyConDataCons + , tyConFamilySize ) +import GHC.Core.DataCon ( dataConTagZ, dataConTyCon, dataConWrapId, dataConWorkId ) import GHC.Core.Utils ( cheapEqExpr, cheapEqExpr', exprIsHNF, exprType , stripTicksTop, stripTicksTopT, mkTicks ) import GHC.Core.Unfold ( exprIsConApp_maybe ) -import Type +import GHC.Core.Type import OccName ( occNameFS ) import PrelNames import Maybes ( orElse ) @@ -55,7 +56,7 @@ import BasicTypes import GHC.Driver.Session import GHC.Platform import Util -import Coercion (mkUnbranchedAxInstCo,mkSymCo,Role(..)) +import GHC.Core.Coercion (mkUnbranchedAxInstCo,mkSymCo,Role(..)) import Control.Applicative ( Alternative(..) ) diff --git a/compiler/prelude/PrimOp.hs b/compiler/prelude/PrimOp.hs index ecce2e791f..4d0bbcee66 100644 --- a/compiler/prelude/PrimOp.hs +++ b/compiler/prelude/PrimOp.hs @@ -36,9 +36,9 @@ import Id ( Id, mkVanillaGlobalWithInfo ) import IdInfo ( vanillaIdInfo, setCafInfo, CafInfo(NoCafRefs) ) import Name import PrelNames ( gHC_PRIMOPWRAPPERS ) -import TyCon ( TyCon, isPrimTyCon, PrimRep(..) ) -import Type -import GHC.Types.RepType ( typePrimRep1, tyConPrimRep1 ) +import GHC.Core.TyCon ( TyCon, isPrimTyCon, PrimRep(..) ) +import GHC.Core.Type +import GHC.Types.RepType ( typePrimRep1, tyConPrimRep1 ) import BasicTypes ( Arity, Fixity(..), FixityDirection(..), Boxity(..), SourceText(..) ) import SrcLoc ( wiredInSrcSpan ) diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs index 7a3a8df8ae..e9cdb81fc8 100644 --- a/compiler/prelude/TysPrim.hs +++ b/compiler/prelude/TysPrim.hs @@ -112,14 +112,14 @@ import {-# SOURCE #-} TysWiredIn import Var ( TyVar, mkTyVar ) import Name -import TyCon +import GHC.Core.TyCon import SrcLoc import Unique import PrelNames import FastString import Outputable -import TyCoRep -- Doesn't need special access, but this is easier to avoid - -- import loops which show up if you import Type instead +import GHC.Core.TyCo.Rep -- Doesn't need special access, but this is easier to avoid + -- import loops which show up if you import Type instead import Data.Char @@ -475,14 +475,14 @@ generator never has to manipulate a value of type 'a :: TYPE rr'. Note [PrimRep and kindPrimRep] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -As part of its source code, in TyCon, GHC has +As part of its source code, in GHC.Core.TyCon, GHC has data PrimRep = LiftedRep | UnliftedRep | IntRep | FloatRep | ...etc... Notice that * RuntimeRep is part of the syntax tree of the program being compiled (defined in a library: ghc-prim:GHC.Types) * PrimRep is part of GHC's source code. - (defined in TyCon) + (defined in GHC.Core.TyCon) We need to get from one to the other; that is what kindPrimRep does. Suppose we have a value @@ -707,7 +707,7 @@ It responds "yes" to Type.isEqPrimPred and classifies as an EqPred in Type.classifyPredType. All wanted constraints of this type are built with coercion holes. -(See Note [Coercion holes] in TyCoRep.) But see also +(See Note [Coercion holes] in GHC.Core.TyCo.Rep.) But see also Note [Deferred errors for coercion holes] in TcErrors to see how equality constraints are deferred. diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index ff28acce8d..908b0e1566 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -140,16 +140,16 @@ import TysPrim import {-# SOURCE #-} KnownUniques -- others: -import CoAxiom +import GHC.Core.Coercion.Axiom import Id import Constants ( mAX_TUPLE_SIZE, mAX_CTUPLE_SIZE, mAX_SUM_SIZE ) import Module ( Module ) -import Type +import GHC.Core.Type import GHC.Types.RepType -import DataCon -import {-# SOURCE #-} ConLike -import TyCon -import Class ( Class, mkClass ) +import GHC.Core.DataCon +import {-# SOURCE #-} GHC.Core.ConLike +import GHC.Core.TyCon +import GHC.Core.Class ( Class, mkClass ) import RdrName import Name import NameEnv ( NameEnv, mkNameEnv, lookupNameEnv, lookupNameEnv_NF ) @@ -933,7 +933,7 @@ mk_tuple Unboxed arity = (tycon, tuple_con) tycon = mkTupleTyCon tc_name tc_binders tc_res_kind tc_arity tuple_con UnboxedTuple flavour - -- See Note [Unboxed tuple RuntimeRep vars] in TyCon + -- See Note [Unboxed tuple RuntimeRep vars] in GHC.Core.TyCon -- Kind: forall (k1:RuntimeRep) (k2:RuntimeRep). TYPE k1 -> TYPE k2 -> # tc_binders = mkTemplateTyConBinders (replicate arity runtimeRepTy) (\ks -> map tYPE ks) diff --git a/compiler/prelude/TysWiredIn.hs-boot b/compiler/prelude/TysWiredIn.hs-boot index b76f58410a..7fe222b825 100644 --- a/compiler/prelude/TysWiredIn.hs-boot +++ b/compiler/prelude/TysWiredIn.hs-boot @@ -1,7 +1,7 @@ module TysWiredIn where -import {-# SOURCE #-} TyCon ( TyCon ) -import {-# SOURCE #-} TyCoRep (Type, Kind) +import {-# SOURCE #-} GHC.Core.TyCon ( TyCon ) +import {-# SOURCE #-} GHC.Core.TyCo.Rep (Type, Kind) import BasicTypes (Arity, TupleSort) import Name (Name) diff --git a/compiler/simplCore/CSE.hs b/compiler/simplCore/CSE.hs index 0f0d5e49d3..81cb825e68 100644 --- a/compiler/simplCore/CSE.hs +++ b/compiler/simplCore/CSE.hs @@ -22,11 +22,11 @@ import Id ( Id, idType, idHasRules , idInlineActivation, setInlineActivation , zapIdOccInfo, zapIdUsageInfo, idInlinePragma , isJoinId, isJoinId_maybe ) -import GHC.Core.Utils ( mkAltExpr, eqExpr +import GHC.Core.Utils ( mkAltExpr, eqExpr , exprIsTickedString , stripTicksE, stripTicksT, mkTicks ) -import GHC.Core.FVs ( exprFreeVars ) -import Type ( tyConAppArgs ) +import GHC.Core.FVs ( exprFreeVars ) +import GHC.Core.Type ( tyConAppArgs ) import GHC.Core import Outputable import BasicTypes diff --git a/compiler/simplCore/Exitify.hs b/compiler/simplCore/Exitify.hs index cf8a2af16f..cbcacfa465 100644 --- a/compiler/simplCore/Exitify.hs +++ b/compiler/simplCore/Exitify.hs @@ -47,7 +47,7 @@ import VarSet import VarEnv import GHC.Core.FVs import FastString -import Type +import GHC.Core.Type import Util( mapSnd ) import Data.Bifunctor diff --git a/compiler/simplCore/FloatIn.hs b/compiler/simplCore/FloatIn.hs index 4a690ccfc4..c1121e16e2 100644 --- a/compiler/simplCore/FloatIn.hs +++ b/compiler/simplCore/FloatIn.hs @@ -30,7 +30,7 @@ import GHC.Core.FVs import CoreMonad ( CoreM ) import Id ( isOneShotBndr, idType, isJoinId, isJoinId_maybe ) import Var -import Type +import GHC.Core.Type import VarSet import Util import GHC.Driver.Session diff --git a/compiler/simplCore/FloatOut.hs b/compiler/simplCore/FloatOut.hs index b8736085dd..8c2b4c93e0 100644 --- a/compiler/simplCore/FloatOut.hs +++ b/compiler/simplCore/FloatOut.hs @@ -28,7 +28,7 @@ import Bag import Util import Maybes import Outputable -import Type +import GHC.Core.Type import qualified Data.IntMap as M import Data.List ( partition ) diff --git a/compiler/simplCore/OccurAnal.hs b/compiler/simplCore/OccurAnal.hs index 161d1a9010..aa8c5730e9 100644 --- a/compiler/simplCore/OccurAnal.hs +++ b/compiler/simplCore/OccurAnal.hs @@ -33,8 +33,8 @@ import IdInfo import Name( localiseName ) import BasicTypes import Module( Module ) -import Coercion -import Type +import GHC.Core.Coercion +import GHC.Core.Type import VarSet import VarEnv diff --git a/compiler/simplCore/SAT.hs b/compiler/simplCore/SAT.hs index 626c4d06b2..23fdff540b 100644 --- a/compiler/simplCore/SAT.hs +++ b/compiler/simplCore/SAT.hs @@ -56,8 +56,8 @@ import GhcPrelude import Var import GHC.Core import GHC.Core.Utils -import Type -import Coercion +import GHC.Core.Type +import GHC.Core.Coercion import Id import Name import VarEnv diff --git a/compiler/simplCore/SetLevels.hs b/compiler/simplCore/SetLevels.hs index e645005b7d..7132b2f596 100644 --- a/compiler/simplCore/SetLevels.hs +++ b/compiler/simplCore/SetLevels.hs @@ -91,10 +91,10 @@ import Demand ( StrictSig, Demand, isStrictDmd, splitStrictSig, increa import Cpr ( mkCprSig, botCpr ) import Name ( getOccName, mkSystemVarName ) import OccName ( occNameString ) -import Type ( Type, mkLamTypes, splitTyConApp_maybe, tyCoVarsOfType +import GHC.Core.Type ( Type, mkLamTypes, splitTyConApp_maybe, tyCoVarsOfType , mightBeUnliftedType, closeOverKindsDSet ) import BasicTypes ( Arity, RecFlag(..), isRec ) -import DataCon ( dataConOrigResTy ) +import GHC.Core.DataCon ( dataConOrigResTy ) import TysWiredIn import UniqSupply import Util diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index e34e390a9a..faeb3c5811 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -34,7 +34,7 @@ import CoreMonad import qualified ErrUtils as Err import FloatIn ( floatInwards ) import FloatOut ( floatOutwards ) -import FamInstEnv +import GHC.Core.FamInstEnv import Id import ErrUtils ( withTiming, withTimingD, DumpFormat (..) ) import BasicTypes ( CompilerPhase(..), isDefaultInlinePragma, defaultInlinePragma ) diff --git a/compiler/simplCore/SimplEnv.hs b/compiler/simplCore/SimplEnv.hs index 9e91d2ea5a..e19b9a19c8 100644 --- a/compiler/simplCore/SimplEnv.hs +++ b/compiler/simplCore/SimplEnv.hs @@ -59,10 +59,10 @@ import Id import GHC.Core.Make ( mkWildValBinder ) import GHC.Driver.Session ( DynFlags ) import TysWiredIn -import qualified Type -import Type hiding ( substTy, substTyVar, substTyVarBndr ) -import qualified Coercion -import Coercion hiding ( substCo, substCoVar, substCoVarBndr ) +import qualified GHC.Core.Type as Type +import GHC.Core.Type hiding ( substTy, substTyVar, substTyVarBndr ) +import qualified GHC.Core.Coercion as Coercion +import GHC.Core.Coercion hiding ( substCo, substCoVar, substCoVarBndr ) import BasicTypes import MonadUtils import Outputable diff --git a/compiler/simplCore/SimplMonad.hs b/compiler/simplCore/SimplMonad.hs index c1045f7875..f26fd18e92 100644 --- a/compiler/simplCore/SimplMonad.hs +++ b/compiler/simplCore/SimplMonad.hs @@ -26,9 +26,9 @@ import Var ( Var, isId, mkLocalVar ) import Name ( mkSystemVarName ) import Id ( Id, mkSysLocalOrCoVar ) import IdInfo ( IdDetails(..), vanillaIdInfo, setArityInfo ) -import Type ( Type, mkLamTypes ) -import FamInstEnv ( FamInstEnv ) -import GHC.Core ( RuleEnv(..) ) +import GHC.Core.Type ( Type, mkLamTypes ) +import GHC.Core.FamInstEnv ( FamInstEnv ) +import GHC.Core ( RuleEnv(..) ) import UniqSupply import GHC.Driver.Session import CoreMonad diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs index cc3214e59b..faf1131d36 100644 --- a/compiler/simplCore/SimplUtils.hs +++ b/compiler/simplCore/SimplUtils.hs @@ -46,7 +46,7 @@ import GHC.Driver.Session import GHC.Core import qualified GHC.Core.Subst import GHC.Core.Ppr -import TyCoPpr ( pprParendType ) +import GHC.Core.TyCo.Ppr ( pprParendType ) import GHC.Core.FVs import GHC.Core.Utils import GHC.Core.Arity @@ -57,9 +57,9 @@ import IdInfo import Var import Demand import SimplMonad -import Type hiding( substTy ) -import Coercion hiding( substCo ) -import DataCon ( dataConWorkId, isNullaryRepDataCon ) +import GHC.Core.Type hiding( substTy ) +import GHC.Core.Coercion hiding( substCo ) +import GHC.Core.DataCon ( dataConWorkId, isNullaryRepDataCon ) import VarSet import BasicTypes import Util diff --git a/compiler/simplCore/Simplify.hs b/compiler/simplCore/Simplify.hs index 6ea8268f10..fc8c861480 100644 --- a/compiler/simplCore/Simplify.hs +++ b/compiler/simplCore/Simplify.hs @@ -15,24 +15,25 @@ import GhcPrelude import GHC.Driver.Session import SimplMonad -import Type hiding ( substTy, substTyVar, extendTvSubst, extendCvSubst ) +import GHC.Core.Type hiding ( substTy, substTyVar, extendTvSubst, extendCvSubst ) import SimplEnv import SimplUtils import OccurAnal ( occurAnalyseExpr ) -import FamInstEnv ( FamInstEnv ) +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.Core.Make ( FloatBind, mkImpossibleExpr, castBottomExpr ) import qualified GHC.Core.Make import IdInfo import Name ( mkSystemVarName, isExternalName, getOccFS ) -import Coercion hiding ( substCo, substCoVar ) -import OptCoercion ( optCoercion ) -import FamInstEnv ( topNormaliseType_maybe ) -import DataCon ( DataCon, dataConWorkId, dataConRepStrictness - , dataConRepArgTys, isUnboxedTupleCon - , StrictnessMark (..) ) +import GHC.Core.Coercion hiding ( substCo, substCoVar ) +import GHC.Core.Coercion.Opt ( optCoercion ) +import GHC.Core.FamInstEnv ( topNormaliseType_maybe ) +import GHC.Core.DataCon + ( DataCon, dataConWorkId, dataConRepStrictness + , dataConRepArgTys, isUnboxedTupleCon + , StrictnessMark (..) ) import CoreMonad ( Tick(..), SimplMode(..) ) import GHC.Core import Demand ( StrictSig(..), dmdTypeDepth, isStrictDmd @@ -48,7 +49,7 @@ import BasicTypes ( TopLevelFlag(..), isNotTopLevel, isTopLevel, RecFlag(..), Arity ) import MonadUtils ( mapAccumLM, liftIO ) import Var ( isTyCoVar ) -import Maybes ( orElse ) +import Maybes ( orElse ) import Control.Monad import Outputable import FastString diff --git a/compiler/specialise/SpecConstr.hs b/compiler/specialise/SpecConstr.hs index b681adfee1..7ab207afc5 100644 --- a/compiler/specialise/SpecConstr.hs +++ b/compiler/specialise/SpecConstr.hs @@ -32,11 +32,11 @@ import CoreMonad import Literal ( litIsLifted ) import GHC.Driver.Types ( ModGuts(..) ) import WwLib ( isWorkerSmallEnough, mkWorkerArgs ) -import DataCon -import Coercion hiding( substCo ) +import GHC.Core.DataCon +import GHC.Core.Coercion hiding( substCo ) import GHC.Core.Rules -import Type hiding ( substTy ) -import TyCon ( tyConName ) +import GHC.Core.Type hiding ( substTy ) +import GHC.Core.TyCon ( tyConName ) import Id import GHC.Core.Ppr ( pprParendExpr ) import GHC.Core.Make ( mkImpossibleExpr ) @@ -61,7 +61,7 @@ import Control.Monad ( zipWithM ) import Data.List import PrelNames ( specTyConName ) import Module -import TyCon ( TyCon ) +import GHC.Core.TyCon ( TyCon ) import GHC.Exts( SpecConstrAnnotation(..) ) import Data.Ord( comparing ) diff --git a/compiler/specialise/Specialise.hs b/compiler/specialise/Specialise.hs index 6ef320f8af..5292512e1d 100644 --- a/compiler/specialise/Specialise.hs +++ b/compiler/specialise/Specialise.hs @@ -17,10 +17,10 @@ import GhcPrelude import Id import TcType hiding( substTy ) -import Type hiding( substTy, extendTvSubstList ) -import Predicate +import GHC.Core.Type hiding( substTy, extendTvSubstList ) +import GHC.Core.Predicate import Module( Module, HasModule(..) ) -import Coercion( Coercion ) +import GHC.Core.Coercion( Coercion ) import CoreMonad import qualified GHC.Core.Subst import GHC.Core.Unfold @@ -47,7 +47,7 @@ import Outputable import FastString import State import UniqDFM -import TyCoRep (TyCoBinder (..)) +import GHC.Core.TyCo.Rep (TyCoBinder (..)) import Control.Monad import qualified Control.Monad.Fail as MonadFail diff --git a/compiler/stranal/CprAnal.hs b/compiler/stranal/CprAnal.hs index 1f244d7a0e..008eb422f8 100644 --- a/compiler/stranal/CprAnal.hs +++ b/compiler/stranal/CprAnal.hs @@ -23,13 +23,13 @@ import Outputable import VarEnv import BasicTypes import Data.List -import DataCon +import GHC.Core.DataCon import Id import IdInfo import GHC.Core.Utils ( exprIsHNF, dumpIdInfoOfProgram ) -import TyCon -import Type -import FamInstEnv +import GHC.Core.TyCon +import GHC.Core.Type +import GHC.Core.FamInstEnv import Util import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) ) import Maybes ( isJust, isNothing ) diff --git a/compiler/stranal/DmdAnal.hs b/compiler/stranal/DmdAnal.hs index 5c5181da12..8f5cb6ddea 100644 --- a/compiler/stranal/DmdAnal.hs +++ b/compiler/stranal/DmdAnal.hs @@ -24,14 +24,14 @@ import Outputable import VarEnv import BasicTypes import Data.List ( mapAccumL ) -import DataCon +import GHC.Core.DataCon import Id import IdInfo import GHC.Core.Utils -import TyCon -import Type -import Coercion ( Coercion, coVarsOfCo ) -import FamInstEnv +import GHC.Core.TyCon +import GHC.Core.Type +import GHC.Core.Coercion ( Coercion, coVarsOfCo ) +import GHC.Core.FamInstEnv import Util import Maybes ( isJust ) import TysWiredIn diff --git a/compiler/stranal/WorkWrap.hs b/compiler/stranal/WorkWrap.hs index 070b2f9046..26554d0a7a 100644 --- a/compiler/stranal/WorkWrap.hs +++ b/compiler/stranal/WorkWrap.hs @@ -17,7 +17,7 @@ import GHC.Core.FVs ( exprFreeVars ) import Var import Id import IdInfo -import Type +import GHC.Core.Type import UniqSupply import BasicTypes import GHC.Driver.Session @@ -26,7 +26,7 @@ import Cpr import WwLib import Util import Outputable -import FamInstEnv +import GHC.Core.FamInstEnv import MonadUtils #include "HsVersions.h" diff --git a/compiler/stranal/WwLib.hs b/compiler/stranal/WwLib.hs index 49e8a7f70b..1102ee52f3 100644 --- a/compiler/stranal/WwLib.hs +++ b/compiler/stranal/WwLib.hs @@ -19,7 +19,7 @@ import GHC.Core import GHC.Core.Utils ( exprType, mkCast, mkDefaultCase, mkSingleAltCase ) import Id import IdInfo ( JoinArity ) -import DataCon +import GHC.Core.DataCon import Demand import Cpr import GHC.Core.Make ( mkAbsentErrorApp, mkCoreUbxTup @@ -30,13 +30,13 @@ import TysPrim ( voidPrimTy ) import Literal ( absentLiteralOf, rubbishLit ) import VarEnv ( mkInScopeSet ) import VarSet ( VarSet ) -import Type -import Predicate ( isClassPred ) -import GHC.Types.RepType ( isVoidTy, typePrimRep ) -import Coercion -import FamInstEnv +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 TyCon +import GHC.Core.TyCon import UniqSupply import Unique import Maybes 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. ************************************************************************ * * |