diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-04-05 17:39:13 +0200 |
---|---|---|
committer | Sylvain Henry <sylvain@haskus.fr> | 2020-04-18 20:04:46 +0200 |
commit | 15312bbb53f247c9ed2c5cf75100a9f44c1c7227 (patch) | |
tree | 8306dcc04a5b7c82464f903044dfdd589e7fdcd7 /compiler/GHC/Tc | |
parent | 3ca52151881451ce5b3a7740d003e811b586140d (diff) | |
download | haskell-15312bbb53f247c9ed2c5cf75100a9f44c1c7227.tar.gz |
Modules (#13009)
* SysTools
* Parser
* GHC.Builtin
* GHC.Iface.Recomp
* Settings
Update Haddock submodule
Metric Decrease:
Naperian
parsing001
Diffstat (limited to 'compiler/GHC/Tc')
42 files changed, 108 insertions, 107 deletions
diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs index 5630bde863..6f5d72a51a 100644 --- a/compiler/GHC/Tc/Deriv.hs +++ b/compiler/GHC/Tc/Deriv.hs @@ -58,7 +58,7 @@ import GHC.Tc.Utils.TcType import GHC.Types.Var as Var import GHC.Types.Var.Env import GHC.Types.Var.Set -import PrelNames +import GHC.Builtin.Names import GHC.Types.SrcLoc import Util import Outputable diff --git a/compiler/GHC/Tc/Deriv/Functor.hs b/compiler/GHC/Tc/Deriv/Functor.hs index d727d7bb98..41aa86080d 100644 --- a/compiler/GHC/Tc/Deriv/Functor.hs +++ b/compiler/GHC/Tc/Deriv/Functor.hs @@ -31,7 +31,7 @@ import GHC.Core.DataCon import FastString import GHC.Hs import Outputable -import PrelNames +import GHC.Builtin.Names import GHC.Types.Name.Reader import GHC.Types.SrcLoc import State @@ -44,7 +44,7 @@ import Util import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Id.Make (coerceId) -import TysWiredIn (true_RDR, false_RDR) +import GHC.Builtin.Types (true_RDR, false_RDR) import Data.Maybe (catMaybes, isJust) diff --git a/compiler/GHC/Tc/Deriv/Generate.hs b/compiler/GHC/Tc/Deriv/Generate.hs index d330d76827..4f00de2427 100644 --- a/compiler/GHC/Tc/Deriv/Generate.hs +++ b/compiler/GHC/Tc/Deriv/Generate.hs @@ -50,21 +50,21 @@ import Fingerprint import Encoding import GHC.Driver.Session -import PrelInfo +import GHC.Builtin.Utils import GHC.Tc.Instance.Family import GHC.Core.FamInstEnv -import PrelNames -import THNames +import GHC.Builtin.Names +import GHC.Builtin.Names.TH import GHC.Types.Id.Make ( coerceId ) -import PrimOp +import GHC.Builtin.PrimOps import GHC.Types.SrcLoc import GHC.Core.TyCon import GHC.Tc.Utils.Env import GHC.Tc.Utils.TcType import GHC.Tc.Validity ( checkValidCoAxBranch ) import GHC.Core.Coercion.Axiom ( coAxiomSingleBranch ) -import TysPrim -import TysWiredIn +import GHC.Builtin.Types.Prim +import GHC.Builtin.Types import GHC.Core.Type import GHC.Core.Class import GHC.Types.Var.Set diff --git a/compiler/GHC/Tc/Deriv/Generics.hs b/compiler/GHC/Tc/Deriv/Generics.hs index d40824e3ea..d4af39d83c 100644 --- a/compiler/GHC/Tc/Deriv/Generics.hs +++ b/compiler/GHC/Tc/Deriv/Generics.hs @@ -36,9 +36,9 @@ import GHC.Iface.Env ( newGlobalBinder ) import GHC.Types.Name hiding ( varName ) import GHC.Types.Name.Reader import GHC.Types.Basic -import TysPrim -import TysWiredIn -import PrelNames +import GHC.Builtin.Types.Prim +import GHC.Builtin.Types +import GHC.Builtin.Names import GHC.Tc.Utils.Env import GHC.Tc.Utils.Monad import GHC.Driver.Types diff --git a/compiler/GHC/Tc/Deriv/Infer.hs b/compiler/GHC/Tc/Deriv/Infer.hs index 47257d6b23..a5351fcf86 100644 --- a/compiler/GHC/Tc/Deriv/Infer.hs +++ b/compiler/GHC/Tc/Deriv/Infer.hs @@ -26,7 +26,7 @@ import ErrUtils import GHC.Tc.Utils.Instantiate import Outputable import Pair -import PrelNames +import GHC.Builtin.Names import GHC.Tc.Deriv.Utils import GHC.Tc.Utils.Env import GHC.Tc.Deriv.Generate @@ -44,7 +44,7 @@ import GHC.Core.Type import GHC.Tc.Solver import GHC.Tc.Validity (validDerivPred) import GHC.Tc.Utils.Unify (buildImplicationFor, checkConstraints) -import TysWiredIn (typeToTypeKind) +import GHC.Builtin.Types (typeToTypeKind) import GHC.Core.Unify (tcUnifyTy) import Util import GHC.Types.Var diff --git a/compiler/GHC/Tc/Deriv/Utils.hs b/compiler/GHC/Tc/Deriv/Utils.hs index 5394a09e23..63c0e3002c 100644 --- a/compiler/GHC/Tc/Deriv/Utils.hs +++ b/compiler/GHC/Tc/Deriv/Utils.hs @@ -38,7 +38,7 @@ import GHC.Iface.Load (loadInterfaceForName) import GHC.Types.Module (getModule) import GHC.Types.Name import Outputable -import PrelNames +import GHC.Builtin.Names import GHC.Types.SrcLoc import GHC.Tc.Deriv.Generate import GHC.Tc.Deriv.Functor @@ -46,7 +46,7 @@ import GHC.Tc.Deriv.Generics import GHC.Tc.Types.Origin import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcType -import THNames (liftClassKey) +import GHC.Builtin.Names.TH (liftClassKey) import GHC.Core.TyCon import GHC.Core.TyCo.Ppr (pprSourceTyCon) import GHC.Core.Type diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index 333e442803..ae08f78443 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -45,7 +45,7 @@ import GHC.Tc.Types.EvTerm import GHC.Hs.Binds ( PatSynBind(..) ) import GHC.Types.Name import GHC.Types.Name.Reader ( lookupGRE_Name, GlobalRdrEnv, mkRdrUnqual ) -import PrelNames ( typeableClassName ) +import GHC.Builtin.Names ( typeableClassName ) import GHC.Types.Id import GHC.Types.Var import GHC.Types.Var.Set diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index b361ca597d..771765901c 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -30,7 +30,7 @@ import GHC.Core.Type import GHC.Core.DataCon import GHC.Types.Name import GHC.Types.Name.Reader ( pprNameProvenance , GlobalRdrElt (..), globalRdrEnvElts ) -import PrelNames ( gHC_ERR ) +import GHC.Builtin.Names ( gHC_ERR ) import GHC.Types.Id import GHC.Types.Var.Set import GHC.Types.Var.Env @@ -59,7 +59,7 @@ import GHC.Hs.Doc ( unpackHDS, DeclDocMap(..) ) import GHC.Driver.Types ( ModIface_(..) ) import GHC.Iface.Load ( loadInterfaceForNameMaybe ) -import PrelInfo (knownKeyNames) +import GHC.Builtin.Utils (knownKeyNames) import GHC.Tc.Errors.Hole.FitTypes diff --git a/compiler/GHC/Tc/Gen/Arrow.hs b/compiler/GHC/Tc/Gen/Arrow.hs index 2cb5427119..58bbb40da2 100644 --- a/compiler/GHC/Tc/Gen/Arrow.hs +++ b/compiler/GHC/Tc/Gen/Arrow.hs @@ -30,9 +30,9 @@ import GHC.Tc.Types.Origin import GHC.Tc.Types.Evidence import GHC.Types.Id( mkLocalId ) import GHC.Tc.Utils.Instantiate -import TysWiredIn +import GHC.Builtin.Types import GHC.Types.Var.Set -import TysPrim +import GHC.Builtin.Types.Prim import GHC.Types.Basic( Arity ) import GHC.Types.SrcLoc import Outputable diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs index 8977ff3cd4..0773e943c7 100644 --- a/compiler/GHC/Tc/Gen/Bind.hs +++ b/compiler/GHC/Tc/Gen/Bind.hs @@ -45,8 +45,8 @@ import GHC.Tc.Instance.Family( tcGetFamInstEnvs ) import GHC.Core.TyCon import GHC.Tc.Utils.TcType import GHC.Core.Type (mkStrLitTy, tidyOpenType, splitTyConApp_maybe, mkCastTy) -import TysPrim -import TysWiredIn( mkBoxedTupleTy ) +import GHC.Builtin.Types.Prim +import GHC.Builtin.Types( mkBoxedTupleTy ) import GHC.Types.Id import GHC.Types.Var as Var import GHC.Types.Var.Set @@ -63,7 +63,7 @@ import Maybes import Util import GHC.Types.Basic import Outputable -import PrelNames( ipClassName ) +import GHC.Builtin.Names( ipClassName ) import GHC.Tc.Validity (checkValidType) import GHC.Types.Unique.FM import GHC.Types.Unique.Set diff --git a/compiler/GHC/Tc/Gen/Default.hs b/compiler/GHC/Tc/Gen/Default.hs index 29fb7ee7e0..bf1132aa3e 100644 --- a/compiler/GHC/Tc/Gen/Default.hs +++ b/compiler/GHC/Tc/Gen/Default.hs @@ -19,7 +19,7 @@ import GHC.Tc.Utils.Zonk import GHC.Tc.Solver import GHC.Tc.Validity import GHC.Tc.Utils.TcType -import PrelNames +import GHC.Builtin.Names import GHC.Types.SrcLoc import Outputable import FastString diff --git a/compiler/GHC/Tc/Gen/Export.hs b/compiler/GHC/Tc/Gen/Export.hs index 283bbce728..b384b494e4 100644 --- a/compiler/GHC/Tc/Gen/Export.hs +++ b/compiler/GHC/Tc/Gen/Export.hs @@ -10,7 +10,7 @@ module GHC.Tc.Gen.Export (tcRnExports, exports_from_avail) where import GhcPrelude import GHC.Hs -import PrelNames +import GHC.Builtin.Names import GHC.Types.Name.Reader import GHC.Tc.Utils.Monad import GHC.Tc.Utils.Env @@ -40,9 +40,9 @@ import FastString (fsLit) import Control.Monad import GHC.Driver.Session -import GHC.Rename.Doc ( rnHsDoc ) -import RdrHsSyn ( setRdrNameSpace ) -import Data.Either ( partitionEithers ) +import GHC.Rename.Doc ( rnHsDoc ) +import GHC.Parser.PostProcess ( setRdrNameSpace ) +import Data.Either ( partitionEithers ) {- ************************************************************************ diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs index 3468a015e5..3048b78afa 100644 --- a/compiler/GHC/Tc/Gen/Expr.hs +++ b/compiler/GHC/Tc/Gen/Expr.hs @@ -36,7 +36,7 @@ where import GhcPrelude import {-# SOURCE #-} GHC.Tc.Gen.Splice( tcSpliceExpr, tcTypedBracket, tcUntypedBracket ) -import THNames( liftStringName, liftName ) +import GHC.Builtin.Names.TH( liftStringName, liftName ) import GHC.Hs import GHC.Tc.Types.Constraint ( HoleSort(..) ) @@ -77,10 +77,10 @@ import GHC.Core.TyCo.Subst (substTyWithInScope) import GHC.Core.Type import GHC.Tc.Types.Evidence import GHC.Types.Var.Set -import TysWiredIn -import TysPrim( intPrimTy ) -import PrimOp( tagToEnumKey ) -import PrelNames +import GHC.Builtin.Types +import GHC.Builtin.Types.Prim( intPrimTy ) +import GHC.Builtin.PrimOps( tagToEnumKey ) +import GHC.Builtin.Names import GHC.Driver.Session import GHC.Types.SrcLoc import Util @@ -2013,14 +2013,14 @@ checkCrossStageLifting top_lvl id (Brack _ (TcPending ps_var lie_var q)) -- just going to flag an error for now ; lift <- if isStringTy id_ty then - do { sid <- tcLookupId THNames.liftStringName + do { sid <- tcLookupId GHC.Builtin.Names.TH.liftStringName -- See Note [Lifting strings] ; return (HsVar noExtField (noLoc sid)) } else setConstraintVar lie_var $ -- Put the 'lift' constraint into the right LIE newMethodFromName (OccurrenceOf id_name) - THNames.liftName + GHC.Builtin.Names.TH.liftName [getRuntimeRep id_ty, id_ty] -- Update the pending splices diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs index 050f3b5b89..f1031d6e14 100644 --- a/compiler/GHC/Tc/Gen/Foreign.hs +++ b/compiler/GHC/Tc/Gen/Foreign.hs @@ -54,7 +54,7 @@ import GHC.Types.Name.Reader import GHC.Core.DataCon import GHC.Core.TyCon import GHC.Tc.Utils.TcType -import PrelNames +import GHC.Builtin.Names import GHC.Driver.Session import Outputable import GHC.Platform diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs index 094ed623ac..313ae9cf58 100644 --- a/compiler/GHC/Tc/Gen/HsType.hs +++ b/compiler/GHC/Tc/Gen/HsType.hs @@ -89,7 +89,7 @@ import GHC.Tc.Errors ( reportAllUnsolved ) import GHC.Tc.Utils.TcType import GHC.Tc.Utils.Instantiate ( tcInstInvisibleTyBinders, tcInstInvisibleTyBinder ) import GHC.Core.Type -import TysPrim +import GHC.Builtin.Types.Prim import GHC.Types.Name.Reader( lookupLocalRdrOcc ) import GHC.Types.Var import GHC.Types.Var.Set @@ -100,10 +100,10 @@ import GHC.Core.Class import GHC.Types.Name -- import GHC.Types.Name.Set import GHC.Types.Var.Env -import TysWiredIn +import GHC.Builtin.Types import GHC.Types.Basic import GHC.Types.SrcLoc -import Constants ( mAX_CTUPLE_SIZE ) +import GHC.Settings.Constants ( mAX_CTUPLE_SIZE ) import ErrUtils( MsgDoc ) import GHC.Types.Unique import GHC.Types.Unique.Set @@ -111,7 +111,7 @@ import Util import GHC.Types.Unique.Supply import Outputable import FastString -import PrelNames hiding ( wildCardName ) +import GHC.Builtin.Names hiding ( wildCardName ) import GHC.Driver.Session import qualified GHC.LanguageExtensions as LangExt @@ -1014,7 +1014,7 @@ bigConstraintTuple arity Note [Ignore unary constraint tuples] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GHC provides unary tuples and unboxed tuples (see Note [One-tuples] in -TysWiredIn) but does *not* provide unary constraint tuples. Why? First, +GHC.Builtin.Types) but does *not* provide unary constraint tuples. Why? First, recall the definition of a unary tuple data type: data Unit a = Unit a @@ -3311,7 +3311,7 @@ Consider An annoying difficulty happens if there are more than 62 inferred constraints. Then we need to fill in the TcTyVar with (say) a 70-tuple. Where do we find the TyCon? For good reasons we only have constraint -tuples up to 62 (see Note [How tuples work] in TysWiredIn). So how +tuples up to 62 (see Note [How tuples work] in GHC.Builtin.Types). So how can we make a 70-tuple? This was the root cause of #14217. It's incredibly tiresome, because we only need this type to fill diff --git a/compiler/GHC/Tc/Gen/Match.hs b/compiler/GHC/Tc/Gen/Match.hs index 8fb7e7da7b..339093b47c 100644 --- a/compiler/GHC/Tc/Gen/Match.hs +++ b/compiler/GHC/Tc/Gen/Match.hs @@ -50,10 +50,10 @@ import GHC.Tc.Gen.Bind import GHC.Tc.Utils.Unify import GHC.Tc.Types.Origin import GHC.Types.Name -import TysWiredIn +import GHC.Builtin.Types import GHC.Types.Id import GHC.Core.TyCon -import TysPrim +import GHC.Builtin.Types.Prim import GHC.Tc.Types.Evidence import Outputable import Util diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs index f218b4e1be..9b3318a78f 100644 --- a/compiler/GHC/Tc/Gen/Pat.hs +++ b/compiler/GHC/Tc/Gen/Pat.hs @@ -47,14 +47,14 @@ import GHC.Core.TyCo.Ppr ( pprTyVars ) import GHC.Tc.Utils.TcType import GHC.Tc.Utils.Unify import GHC.Tc.Gen.HsType -import TysWiredIn +import GHC.Builtin.Types import GHC.Tc.Types.Evidence import GHC.Tc.Types.Origin import GHC.Core.TyCon import GHC.Core.DataCon import GHC.Core.PatSyn import GHC.Core.ConLike -import PrelNames +import GHC.Builtin.Names import GHC.Types.Basic hiding (SuccessFlag(..)) import GHC.Driver.Session import GHC.Types.SrcLoc diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs index cf7bd3c51d..83fab20ca5 100644 --- a/compiler/GHC/Tc/Gen/Sig.hs +++ b/compiler/GHC/Tc/Gen/Sig.hs @@ -44,7 +44,7 @@ import GHC.Core.Type ( mkTyVarBinders ) import GHC.Driver.Session import GHC.Types.Var ( TyVar, tyVarKind ) import GHC.Types.Id ( Id, idName, idType, idInlinePragma, setInlinePragma, mkLocalId ) -import PrelNames( mkUnboundName ) +import GHC.Builtin.Names( mkUnboundName ) import GHC.Types.Basic import GHC.Types.Module( getModule ) import GHC.Types.Name diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs index f60f6682d2..87b23a8b27 100644 --- a/compiler/GHC/Tc/Gen/Splice.hs +++ b/compiler/GHC/Tc/Gen/Splice.hs @@ -46,12 +46,12 @@ import GHC.Tc.Utils.TcType import Outputable import GHC.Tc.Gen.Expr import GHC.Types.SrcLoc -import THNames +import GHC.Builtin.Names.TH import GHC.Tc.Utils.Unify import GHC.Tc.Utils.Env import GHC.Tc.Types.Origin import GHC.Core.Coercion( etaExpandCoAxBranch ) -import FileCleanup ( newTempName, TempFileLifetime(..) ) +import GHC.SysTools.FileCleanup ( newTempName, TempFileLifetime(..) ) import Control.Monad @@ -84,8 +84,8 @@ import GHC.Core.FamInstEnv import GHC.Core.InstEnv as InstEnv import GHC.Tc.Utils.Instantiate import GHC.Types.Name.Env -import PrelNames -import TysWiredIn +import GHC.Builtin.Names +import GHC.Builtin.Types import GHC.Types.Name.Occurrence as OccName import GHC.Driver.Hooks import GHC.Types.Var diff --git a/compiler/GHC/Tc/Instance/Class.hs b/compiler/GHC/Tc/Instance/Class.hs index 81ee5aec71..53054de7f8 100644 --- a/compiler/GHC/Tc/Instance/Class.hs +++ b/compiler/GHC/Tc/Instance/Class.hs @@ -26,9 +26,9 @@ import GHC.Core.InstEnv import GHC.Tc.Utils.Instantiate( instDFunType ) import GHC.Tc.Instance.Family( tcGetFamInstEnvs, tcInstNewTyCon_maybe, tcLookupDataFamInst ) -import TysWiredIn -import TysPrim( eqPrimTyCon, eqReprPrimTyCon ) -import PrelNames +import GHC.Builtin.Types +import GHC.Builtin.Types.Prim( eqPrimTyCon, eqReprPrimTyCon ) +import GHC.Builtin.Names import GHC.Types.Id import GHC.Core.Type @@ -569,7 +569,7 @@ if you'd written * * ***********************************************************************-} --- See also Note [The equality types story] in TysPrim +-- See also Note [The equality types story] in GHC.Builtin.Types.Prim matchHeteroEquality :: [Type] -> TcM ClsInstResult -- Solves (t1 ~~ t2) matchHeteroEquality args @@ -585,7 +585,7 @@ matchHomoEquality args@[k,t1,t2] , cir_what = BuiltinEqInstance }) matchHomoEquality args = pprPanic "matchHomoEquality" (ppr args) --- See also Note [The equality types story] in TysPrim +-- See also Note [The equality types story] in GHC.Builtin.Types.Prim matchCoercible :: [Type] -> TcM ClsInstResult matchCoercible args@[k, t1, t2] = return (OneInst { cir_new_theta = [ mkTyConApp eqReprPrimTyCon args' ] diff --git a/compiler/GHC/Tc/Instance/FunDeps.hs b/compiler/GHC/Tc/Instance/FunDeps.hs index 73a1317692..40344af9ed 100644 --- a/compiler/GHC/Tc/Instance/FunDeps.hs +++ b/compiler/GHC/Tc/Instance/FunDeps.hs @@ -516,7 +516,7 @@ Note [Equality superclasses] Suppose we have class (a ~ [b]) => C a b -Remember from Note [The equality types story] in TysPrim, that +Remember from Note [The equality types story] in GHC.Builtin.Types.Prim, that * (a ~~ b) is a superclass of (a ~ b) * (a ~# b) is a superclass of (a ~~ b) diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs index 842157a3d4..c3e59b2f4c 100644 --- a/compiler/GHC/Tc/Instance/Typeable.hs +++ b/compiler/GHC/Tc/Instance/Typeable.hs @@ -23,9 +23,10 @@ import GHC.Tc.Types.Evidence ( mkWpTyApps ) import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcType import GHC.Driver.Types ( lookupId ) -import PrelNames -import TysPrim ( primTyCons ) -import TysWiredIn ( tupleTyCon, sumTyCon, runtimeRepTyCon +import GHC.Builtin.Names +import GHC.Builtin.Types.Prim ( primTyCons ) +import GHC.Builtin.Types + ( tupleTyCon, sumTyCon, runtimeRepTyCon , vecCountTyCon, vecElemTyCon , nilDataCon, consDataCon ) import GHC.Types.Name @@ -39,7 +40,7 @@ import GHC.Driver.Session import Bag import GHC.Types.Var ( VarBndr(..) ) import GHC.Core.Map -import Constants +import GHC.Settings.Constants import Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints) import Outputable import FastString ( FastString, mkFastString, fsLit ) diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 091968ed21..17f2dd69d5 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -62,15 +62,15 @@ import GHC.Rename.HsType import GHC.Rename.Expr import GHC.Rename.Utils ( HsDocContext(..) ) import GHC.Rename.Fixity ( lookupFixityRn ) -import TysWiredIn ( unitTy, mkListTy ) +import GHC.Builtin.Types ( unitTy, mkListTy ) import GHC.Driver.Plugins import GHC.Driver.Session import GHC.Hs import GHC.Iface.Syntax ( ShowSub(..), showToHeader ) import GHC.Iface.Type ( ShowForAllFlag(..) ) import GHC.Core.PatSyn( pprPatSynType ) -import PrelNames -import PrelInfo +import GHC.Builtin.Names +import GHC.Builtin.Utils import GHC.Types.Name.Reader import GHC.Tc.Utils.Zonk import GHC.Tc.Gen.Expr @@ -90,7 +90,7 @@ import GHC.Core.FamInstEnv import GHC.Tc.Gen.Annotation import GHC.Tc.Gen.Bind import GHC.Iface.Make ( coAxiomToIfaceDecl ) -import HeaderInfo ( mkPrelImports ) +import GHC.Parser.Header ( mkPrelImports ) import GHC.Tc.Gen.Default import GHC.Tc.Utils.Env import GHC.Tc.Gen.Rule diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs index ad2c7816d2..c060eac638 100644 --- a/compiler/GHC/Tc/Solver.hs +++ b/compiler/GHC/Tc/Solver.hs @@ -36,8 +36,8 @@ import GHC.Tc.Utils.Instantiate import ListSetOps import GHC.Types.Name import Outputable -import PrelInfo -import PrelNames +import GHC.Builtin.Utils +import GHC.Builtin.Names import GHC.Tc.Errors import GHC.Tc.Types.Evidence import GHC.Tc.Solver.Interact @@ -50,8 +50,8 @@ import GHC.Core.Predicate import GHC.Tc.Types.Origin import GHC.Tc.Utils.TcType import GHC.Core.Type -import TysWiredIn ( liftedRepTy ) -import GHC.Core.Unify ( tcMatchTyKi ) +import GHC.Builtin.Types ( liftedRepTy ) +import GHC.Core.Unify ( tcMatchTyKi ) import Util import GHC.Types.Var import GHC.Types.Var.Set @@ -665,7 +665,7 @@ tcNormalise given_ids ty Expand superclasses before starting, because (Int ~ Bool), has (Int ~~ Bool) as a superclass, which in turn has (Int ~N# Bool) as a superclass, and it's the latter that is insoluble. See -Note [The equality types story] in TysPrim. +Note [The equality types story] in GHC.Builtin.Types.Prim. If we fail to prove unsatisfiability we (arbitrarily) try just once to find superclasses, using try_harder. Reason: we might have a type diff --git a/compiler/GHC/Tc/Solver/Interact.hs b/compiler/GHC/Tc/Solver/Interact.hs index f9e0562c7b..acb9ca5543 100644 --- a/compiler/GHC/Tc/Solver/Interact.hs +++ b/compiler/GHC/Tc/Solver/Interact.hs @@ -24,7 +24,7 @@ import GHC.Core.Coercion.Axiom ( sfInteractTop, sfInteractInert ) import GHC.Types.Var import GHC.Tc.Utils.TcType -import PrelNames ( coercibleTyConKey, +import GHC.Builtin.Names ( coercibleTyConKey, heqTyConKey, eqTyConKey, ipClassKey ) import GHC.Core.Coercion.Axiom ( TypeEqn, CoAxiom(..), CoAxBranch(..), fromBranches ) import GHC.Core.Class @@ -2489,7 +2489,7 @@ matchClassInst dflags inerts clas tys loc -- | If a class is "naturally coherent", then we needn't worry at all, in any -- way, about overlapping/incoherent instances. Just solve the thing! -- See Note [Naturally coherent classes] --- See also Note [The equality class story] in TysPrim. +-- See also Note [The equality class story] in GHC.Builtin.Types.Prim. naturallyCoherentClass :: Class -> Bool naturallyCoherentClass cls = isCTupleClass cls @@ -2590,7 +2590,7 @@ For example, consider (~~), which behaves as if it was defined like this: class a ~# b => a ~~ b instance a ~# b => a ~~ b -(See Note [The equality types story] in TysPrim.) +(See Note [The equality types story] in GHC.Builtin.Types.Prim.) Faced with [W] t1 ~~ t2, it's always OK to reduce it to [W] t1 ~# t2, without worrying about Note [Instance and Given overlap]. Why? Because diff --git a/compiler/GHC/Tc/Solver/Monad.hs b/compiler/GHC/Tc/Solver/Monad.hs index 0aea474320..822ccb2248 100644 --- a/compiler/GHC/Tc/Solver/Monad.hs +++ b/compiler/GHC/Tc/Solver/Monad.hs @@ -246,7 +246,7 @@ Note [Prioritise class equalities] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ We prioritise equalities in the solver (see selectWorkItem). But class constraints like (a ~ b) and (a ~~ b) are actually equalities too; -see Note [The equality types story] in TysPrim. +see Note [The equality types story] in GHC.Builtin.Types.Prim. Failing to prioritise these is inefficient (more kick-outs etc). But, worse, it can prevent us spotting a "recursive knot" among diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index 612348c4f3..07d1453a5c 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -42,7 +42,7 @@ import GHC.Tc.Utils.Unify ( checkTvConstraints ) import GHC.Tc.Gen.HsType import GHC.Tc.Instance.Class( AssocInstInfo(..) ) import GHC.Tc.Utils.TcMType -import TysWiredIn ( unitTy, makeRecoveryTyCon ) +import GHC.Builtin.Types ( unitTy, makeRecoveryTyCon ) import GHC.Tc.Utils.TcType import GHC.Rename.Env( lookupConstructorFields ) import GHC.Tc.Instance.Family diff --git a/compiler/GHC/Tc/TyCl/Build.hs b/compiler/GHC/Tc/TyCl/Build.hs index a118630fda..908f1398d7 100644 --- a/compiler/GHC/Tc/TyCl/Build.hs +++ b/compiler/GHC/Tc/TyCl/Build.hs @@ -21,8 +21,8 @@ import GhcPrelude import GHC.Iface.Env import GHC.Core.FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom ) -import TysWiredIn( isCTupleTyConName ) -import TysPrim ( voidPrimTy ) +import GHC.Builtin.Types( isCTupleTyConName ) +import GHC.Builtin.Types.Prim ( voidPrimTy ) import GHC.Core.DataCon import GHC.Core.PatSyn import GHC.Types.Var diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index 6bee37fafd..0a719d90d2 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -30,7 +30,7 @@ import GHC.Tc.Gen.Sig( emptyPragEnv, completeSigFromId ) import GHC.Tc.Utils.Env import GHC.Tc.Utils.TcMType import GHC.Tc.Utils.Zonk -import TysPrim +import GHC.Builtin.Types.Prim import GHC.Types.Name import GHC.Types.SrcLoc import GHC.Core.PatSyn @@ -47,7 +47,7 @@ import GHC.Types.Basic import GHC.Tc.Solver import GHC.Tc.Utils.Unify import GHC.Core.Predicate -import TysWiredIn +import GHC.Builtin.Types import GHC.Tc.Utils.TcType import GHC.Tc.Types.Evidence import GHC.Tc.Types.Origin diff --git a/compiler/GHC/Tc/TyCl/Utils.hs b/compiler/GHC/Tc/TyCl/Utils.hs index 3101a96ac5..d12e7efce4 100644 --- a/compiler/GHC/Tc/TyCl/Utils.hs +++ b/compiler/GHC/Tc/TyCl/Utils.hs @@ -38,7 +38,7 @@ import GHC.Tc.Gen.Bind( tcValBinds ) import GHC.Core.TyCo.Rep( Type(..), Coercion(..), MCoercion(..), UnivCoProvenance(..) ) import GHC.Tc.Utils.TcType import GHC.Core.Predicate -import TysWiredIn( unitTy ) +import GHC.Builtin.Types( unitTy ) import GHC.Core.Make( rEC_SEL_ERROR_ID ) import GHC.Hs import GHC.Core.Class diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index dcf6fc94b6..e5f5fdbf50 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -120,7 +120,7 @@ import Outputable import ListSetOps import Fingerprint import Util -import PrelNames ( isUnboundName ) +import GHC.Builtin.Names ( isUnboundName ) import GHC.Types.CostCentre.State import Control.Monad (ap) diff --git a/compiler/GHC/Tc/Types/EvTerm.hs b/compiler/GHC/Tc/Types/EvTerm.hs index db5c6d1ce1..09f016ca71 100644 --- a/compiler/GHC/Tc/Types/EvTerm.hs +++ b/compiler/GHC/Tc/Types/EvTerm.hs @@ -17,7 +17,7 @@ import GHC.Driver.Session import GHC.Types.Name import GHC.Types.Module import GHC.Core.Utils -import PrelNames +import GHC.Builtin.Names import GHC.Types.SrcLoc -- Used with Opt_DeferTypeErrors diff --git a/compiler/GHC/Tc/Types/Evidence.hs b/compiler/GHC/Tc/Types/Evidence.hs index cf59896f9d..922055ebf5 100644 --- a/compiler/GHC/Tc/Types/Evidence.hs +++ b/compiler/GHC/Tc/Types/Evidence.hs @@ -64,7 +64,7 @@ import GHC.Core.Type import GHC.Core.TyCon import GHC.Core.DataCon( DataCon, dataConWrapId ) import GHC.Core.Class( Class ) -import PrelNames +import GHC.Builtin.Names import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Core.Predicate diff --git a/compiler/GHC/Tc/Utils/Backpack.hs b/compiler/GHC/Tc/Utils/Backpack.hs index 93cb63812c..fc134817be 100644 --- a/compiler/GHC/Tc/Utils/Backpack.hs +++ b/compiler/GHC/Tc/Utils/Backpack.hs @@ -56,7 +56,7 @@ import Maybes import GHC.Tc.Utils.Env import GHC.Types.Var import GHC.Iface.Syntax -import PrelNames +import GHC.Builtin.Names import qualified Data.Map as Map import GHC.Driver.Finder diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs index 95722733be..cf55316b22 100644 --- a/compiler/GHC/Tc/Utils/Env.hs +++ b/compiler/GHC/Tc/Utils/Env.hs @@ -79,8 +79,8 @@ import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcMType import GHC.Tc.Utils.TcType import GHC.Iface.Load -import PrelNames -import TysWiredIn +import GHC.Builtin.Names +import GHC.Builtin.Types import GHC.Types.Id import GHC.Types.Var import GHC.Types.Name.Reader diff --git a/compiler/GHC/Tc/Utils/Instantiate.hs b/compiler/GHC/Tc/Utils/Instantiate.hs index 563ddff69d..e896c7851e 100644 --- a/compiler/GHC/Tc/Utils/Instantiate.hs +++ b/compiler/GHC/Tc/Utils/Instantiate.hs @@ -50,7 +50,7 @@ import GHC.Tc.Types.Origin import GHC.Tc.Utils.Env import GHC.Tc.Types.Evidence import GHC.Core.InstEnv -import TysWiredIn ( heqDataCon, eqDataCon ) +import GHC.Builtin.Types ( heqDataCon, eqDataCon ) import GHC.Core ( isOrphan ) import GHC.Tc.Instance.FunDeps import GHC.Tc.Utils.TcMType @@ -67,7 +67,7 @@ import GHC.Types.Name import GHC.Types.Var ( EvVar, tyVarName, VarBndr(..) ) import GHC.Core.DataCon import GHC.Types.Var.Env -import PrelNames +import GHC.Builtin.Names import GHC.Types.SrcLoc as SrcLoc import GHC.Driver.Session import Util diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index bd52015c89..0b84f69096 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -161,7 +161,7 @@ import GHC.Core.Type import GHC.Tc.Utils.TcType import GHC.Core.InstEnv import GHC.Core.FamInstEnv -import PrelNames +import GHC.Builtin.Names import GHC.Types.Id import GHC.Types.Var.Set diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs index 1469170847..53b93f51a3 100644 --- a/compiler/GHC/Tc/Utils/TcMType.hs +++ b/compiler/GHC/Tc/Utils/TcMType.hs @@ -114,11 +114,11 @@ import GHC.Tc.Types.Evidence import GHC.Types.Id as Id import GHC.Types.Name import GHC.Types.Var.Set -import TysWiredIn -import TysPrim +import GHC.Builtin.Types +import GHC.Builtin.Types.Prim import GHC.Types.Var.Env import GHC.Types.Name.Env -import PrelNames +import GHC.Builtin.Names import Util import Outputable import FastString diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index 1f076e2101..8e1cef1a86 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -213,9 +213,9 @@ import GHC.Types.Name as Name -- Perhaps there's a better way to do this? import GHC.Types.Name.Set import GHC.Types.Var.Env -import PrelNames -import TysWiredIn( coercibleClass, eqClass, heqClass, unitTyCon, unitTyConKey - , listTyCon, constraintKind ) +import GHC.Builtin.Names +import GHC.Builtin.Types ( coercibleClass, eqClass, heqClass, unitTyCon, unitTyConKey + , listTyCon, constraintKind ) import GHC.Types.Basic import Util import Maybes @@ -1115,7 +1115,7 @@ findDupTyVarTvs prs {- ************************************************************************ * * -\subsection{Tau, sigma and rho} + Tau, sigma and rho * * ************************************************************************ -} @@ -1176,7 +1176,7 @@ mkTcCastTy = mkCastTy -- Do we need a tc version of mkCastTy? {- ************************************************************************ * * -\subsection{Expanding and splitting} + Expanding and splitting * * ************************************************************************ @@ -2119,7 +2119,7 @@ isAlmostFunctionFree (CoercionTy {}) = True {- ************************************************************************ * * -\subsection{Misc} + Misc * * ************************************************************************ @@ -2171,7 +2171,7 @@ end of the compiler. {- ************************************************************************ * * -\subsection[TysWiredIn-ext-type]{External types} + External types * * ************************************************************************ diff --git a/compiler/GHC/Tc/Utils/Unify.hs b/compiler/GHC/Tc/Utils/Unify.hs index f6d934af9a..c6b0f8bae4 100644 --- a/compiler/GHC/Tc/Utils/Unify.hs +++ b/compiler/GHC/Tc/Utils/Unify.hs @@ -57,8 +57,8 @@ import GHC.Tc.Types.Origin import GHC.Types.Name( isSystemName ) import GHC.Tc.Utils.Instantiate import GHC.Core.TyCon -import TysWiredIn -import TysPrim( tYPE ) +import GHC.Builtin.Types +import GHC.Builtin.Types.Prim( tYPE ) import GHC.Types.Var as Var import GHC.Types.Var.Set import GHC.Types.Var.Env diff --git a/compiler/GHC/Tc/Utils/Zonk.hs b/compiler/GHC/Tc/Utils/Zonk.hs index 1cbb8415a3..4cf02d41e0 100644 --- a/compiler/GHC/Tc/Utils/Zonk.hs +++ b/compiler/GHC/Tc/Utils/Zonk.hs @@ -53,16 +53,16 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Core.Predicate import GHC.Tc.Utils.Monad -import PrelNames +import GHC.Builtin.Names import GHC.Tc.TyCl.Build ( TcMethInfo, MethInfo ) import GHC.Tc.Utils.TcType import GHC.Tc.Utils.TcMType import GHC.Tc.Utils.Env ( tcLookupGlobalOnly ) import GHC.Tc.Types.Evidence import GHC.Core.TyCo.Ppr ( pprTyVar ) -import TysPrim +import GHC.Builtin.Types.Prim import GHC.Core.TyCon -import TysWiredIn +import GHC.Builtin.Types import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.ConLike diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs index 2fe9d16595..6e44a6c399 100644 --- a/compiler/GHC/Tc/Validity.hs +++ b/compiler/GHC/Tc/Validity.hs @@ -34,8 +34,8 @@ import GHC.Core.TyCo.FVs import GHC.Core.TyCo.Rep import GHC.Core.TyCo.Ppr import GHC.Tc.Utils.TcType hiding ( sizeType, sizeTypes ) -import TysWiredIn ( heqTyConName, eqTyConName, coercibleTyConName ) -import PrelNames +import GHC.Builtin.Types ( heqTyConName, eqTyConName, coercibleTyConName ) +import GHC.Builtin.Names import GHC.Core.Type import GHC.Core.Unify ( tcMatchTyX_BM, BindFlag(..) ) import GHC.Core.Coercion |