diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-04-20 16:54:38 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-04-26 13:55:14 -0400 |
commit | af332442123878c1b61d236dce46418efcbe8750 (patch) | |
tree | ec4b332843cdd4fedb4aa60b11b7b8dba82a0764 | |
parent | b0fbfc7582fb81314dc28a056536737fb5eeaa6e (diff) | |
download | haskell-af332442123878c1b61d236dce46418efcbe8750.tar.gz |
Modules: Utils and Data (#13009)
Update Haddock submodule
Metric Increase:
haddock.compiler
565 files changed, 2390 insertions, 2370 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs index b78883c42e..a46218665a 100644 --- a/compiler/GHC.hs +++ b/compiler/GHC.hs @@ -293,7 +293,7 @@ module GHC ( #include "HsVersions.h" -import GhcPrelude hiding (init) +import GHC.Prelude hiding (init) import GHC.ByteCode.Types import GHC.Runtime.Eval @@ -342,16 +342,16 @@ import GHC.SysTools import GHC.SysTools.BaseDir import GHC.Types.Annotations import GHC.Types.Module -import Panic +import GHC.Utils.Panic import GHC.Platform -import Bag ( listToBag ) -import ErrUtils -import MonadUtils -import Util -import StringBuffer -import Outputable +import GHC.Data.Bag ( listToBag ) +import GHC.Utils.Error +import GHC.Utils.Monad +import GHC.Utils.Misc +import GHC.Data.StringBuffer +import GHC.Utils.Outputable import GHC.Types.Basic -import FastString +import GHC.Data.FastString import qualified GHC.Parser as Parser import GHC.Parser.Lexer import GHC.Parser.Annotation @@ -373,13 +373,13 @@ import Data.Typeable ( Typeable ) import Data.Word ( Word8 ) import Control.Monad import System.Exit ( exitWith, ExitCode(..) ) -import Exception +import GHC.Utils.Exception import Data.IORef import System.FilePath import Control.Concurrent import Control.Applicative ((<|>)) -import Maybes +import GHC.Data.Maybe import System.IO.Error ( isDoesNotExistError ) import System.Environment ( getEnv ) import System.Directory diff --git a/compiler/GHC/Builtin/Names.hs b/compiler/GHC/Builtin/Names.hs index 1b1bfdf7fe..70a48dd350 100644 --- a/compiler/GHC/Builtin/Names.hs +++ b/compiler/GHC/Builtin/Names.hs @@ -159,7 +159,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Module import GHC.Types.Name.Occurrence @@ -167,7 +167,7 @@ import GHC.Types.Name.Reader import GHC.Types.Unique import GHC.Types.Name import GHC.Types.SrcLoc -import FastString +import GHC.Data.FastString {- ************************************************************************ diff --git a/compiler/GHC/Builtin/Names/TH.hs b/compiler/GHC/Builtin/Names/TH.hs index 7f83cd7521..5123754c55 100644 --- a/compiler/GHC/Builtin/Names/TH.hs +++ b/compiler/GHC/Builtin/Names/TH.hs @@ -6,7 +6,7 @@ module GHC.Builtin.Names.TH where -import GhcPrelude () +import GHC.Prelude () import GHC.Builtin.Names( mk_known_key_name ) import GHC.Types.Module( Module, mkModuleNameFS, mkModule, thUnitId ) @@ -14,7 +14,7 @@ import GHC.Types.Name( Name ) import GHC.Types.Name.Occurrence( tcName, clsName, dataName, varName ) import GHC.Types.Name.Reader( RdrName, nameRdrName ) import GHC.Types.Unique -import FastString +import GHC.Data.FastString -- To add a name, do three things -- diff --git a/compiler/GHC/Builtin/PrimOps.hs b/compiler/GHC/Builtin/PrimOps.hs index b6d7f898ef..1c53df523b 100644 --- a/compiler/GHC/Builtin/PrimOps.hs +++ b/compiler/GHC/Builtin/PrimOps.hs @@ -25,7 +25,7 @@ module GHC.Builtin.PrimOps ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Types.Prim import GHC.Builtin.Types @@ -45,8 +45,8 @@ import GHC.Types.SrcLoc ( wiredInSrcSpan ) import GHC.Types.ForeignCall ( CLabelString ) import GHC.Types.Unique ( Unique, mkPrimOpIdUnique, mkPrimOpWrapperUnique ) import GHC.Types.Module ( UnitId ) -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString {- ************************************************************************ diff --git a/compiler/GHC/Builtin/PrimOps.hs-boot b/compiler/GHC/Builtin/PrimOps.hs-boot index e9f913f602..506e8bca60 100644 --- a/compiler/GHC/Builtin/PrimOps.hs-boot +++ b/compiler/GHC/Builtin/PrimOps.hs-boot @@ -1,5 +1,5 @@ module GHC.Builtin.PrimOps where -import GhcPrelude () +import GHC.Prelude () data PrimOp diff --git a/compiler/GHC/Builtin/Types.hs b/compiler/GHC/Builtin/Types.hs index 2e4ba28b6a..c1241fa7dd 100644 --- a/compiler/GHC/Builtin/Types.hs +++ b/compiler/GHC/Builtin/Types.hs @@ -130,7 +130,7 @@ module GHC.Builtin.Types ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Types.Id.Make ( mkDataConWorkId, mkDictSelId ) @@ -159,10 +159,10 @@ import GHC.Types.ForeignCall import GHC.Types.SrcLoc ( noSrcSpan ) import GHC.Types.Unique import Data.Array -import FastString -import Outputable -import Util -import BooleanFormula ( mkAnd ) +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc +import GHC.Data.BooleanFormula ( mkAnd ) import qualified Data.ByteString.Char8 as BS diff --git a/compiler/GHC/Builtin/Types/Literals.hs b/compiler/GHC/Builtin/Types/Literals.hs index d5c1d209c6..ef6fb962fd 100644 --- a/compiler/GHC/Builtin/Types/Literals.hs +++ b/compiler/GHC/Builtin/Types/Literals.hs @@ -21,10 +21,10 @@ module GHC.Builtin.Types.Literals , typeSymbolAppendTyCon ) where -import GhcPrelude +import GHC.Prelude import GHC.Core.Type -import Pair +import GHC.Data.Pair import GHC.Tc.Utils.TcType ( TcType, tcEqType ) import GHC.Core.TyCon ( TyCon, FamTyConFlav(..), mkFamilyTyCon , Injectivity(..) ) @@ -33,7 +33,7 @@ import GHC.Tc.Types.Constraint ( Xi ) import GHC.Core.Coercion.Axiom ( CoAxiomRule(..), BuiltInSynFamily(..), TypeEqn ) import GHC.Types.Name ( Name, BuiltInSyntax(..) ) import GHC.Builtin.Types -import GHC.Builtin.Types.Prim ( mkTemplateAnonTyConBinders ) +import GHC.Builtin.Types.Prim ( mkTemplateAnonTyConBinders ) import GHC.Builtin.Names ( gHC_TYPELITS , gHC_TYPENATS @@ -49,9 +49,7 @@ import GHC.Builtin.Names , typeSymbolCmpTyFamNameKey , typeSymbolAppendFamNameKey ) -import FastString ( FastString - , fsLit, nilFS, nullFS, unpackFS, mkFastString, appendFS - ) +import GHC.Data.FastString import qualified Data.Map as Map import Data.Maybe ( isJust ) import Control.Monad ( guard ) diff --git a/compiler/GHC/Builtin/Types/Prim.hs b/compiler/GHC/Builtin/Types/Prim.hs index 4bee18b964..e138780c44 100644 --- a/compiler/GHC/Builtin/Types/Prim.hs +++ b/compiler/GHC/Builtin/Types/Prim.hs @@ -90,7 +90,7 @@ module GHC.Builtin.Types.Prim( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Builtin.Types ( runtimeRepTy, unboxedTupleKind, liftedTypeKind @@ -116,8 +116,8 @@ import GHC.Core.TyCon import GHC.Types.SrcLoc import GHC.Types.Unique import GHC.Builtin.Names -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable 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 diff --git a/compiler/GHC/Builtin/Uniques.hs b/compiler/GHC/Builtin/Uniques.hs index d73544378b..5c0e29b7de 100644 --- a/compiler/GHC/Builtin/Uniques.hs +++ b/compiler/GHC/Builtin/Uniques.hs @@ -26,17 +26,17 @@ module GHC.Builtin.Uniques #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Types import GHC.Core.TyCon import GHC.Core.DataCon import GHC.Types.Id import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Name -import Util +import GHC.Utils.Misc import Data.Bits import Data.Maybe diff --git a/compiler/GHC/Builtin/Uniques.hs-boot b/compiler/GHC/Builtin/Uniques.hs-boot index f00490b538..3e24cd5a55 100644 --- a/compiler/GHC/Builtin/Uniques.hs-boot +++ b/compiler/GHC/Builtin/Uniques.hs-boot @@ -1,6 +1,6 @@ module GHC.Builtin.Uniques where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique import GHC.Types.Name import GHC.Types.Basic diff --git a/compiler/GHC/Builtin/Utils.hs b/compiler/GHC/Builtin/Utils.hs index 2b8b0bf698..dc03f051bb 100644 --- a/compiler/GHC/Builtin/Utils.hs +++ b/compiler/GHC/Builtin/Utils.hs @@ -47,7 +47,7 @@ module GHC.Builtin.Utils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Uniques import GHC.Types.Unique ( isValidKnownKeyUnique ) @@ -63,14 +63,14 @@ import GHC.Types.Id import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.Id.Make -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Types.Prim import GHC.Builtin.Types import GHC.Driver.Types import GHC.Core.Class import GHC.Core.TyCon import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import GHC.Builtin.Types.Literals ( typeNatTyCons ) import GHC.Hs.Doc diff --git a/compiler/GHC/ByteCode/Asm.hs b/compiler/GHC/ByteCode/Asm.hs index f957215d38..9ed0283394 100644 --- a/compiler/GHC/ByteCode/Asm.hs +++ b/compiler/GHC/ByteCode/Asm.hs @@ -15,7 +15,7 @@ module GHC.ByteCode.Asm ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.ByteCode.Instr import GHC.ByteCode.InfoTable @@ -28,13 +28,13 @@ import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Literal import GHC.Core.TyCon -import FastString +import GHC.Data.FastString import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Runtime.Heap.Layout import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable import GHC.Platform -import Util +import GHC.Utils.Misc import GHC.Types.Unique import GHC.Types.Unique.DSet diff --git a/compiler/GHC/ByteCode/InfoTable.hs b/compiler/GHC/ByteCode/InfoTable.hs index 93fc4970c4..73f55f63cc 100644 --- a/compiler/GHC/ByteCode/InfoTable.hs +++ b/compiler/GHC/ByteCode/InfoTable.hs @@ -9,7 +9,7 @@ module GHC.ByteCode.InfoTable ( mkITbls ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.ByteCode.Types import GHC.Runtime.Interpreter @@ -22,8 +22,8 @@ import GHC.Core.TyCon ( TyCon, tyConFamilySize, isDataTyCon, tyConDataCons import GHC.Types.RepType import GHC.StgToCmm.Layout ( mkVirtConstrSizes ) import GHC.StgToCmm.Closure ( tagForCon, NonVoid (..) ) -import Util -import Panic +import GHC.Utils.Misc +import GHC.Utils.Panic {- Manufacturing of info tables for DataCons diff --git a/compiler/GHC/ByteCode/Instr.hs b/compiler/GHC/ByteCode/Instr.hs index b473f418e3..8aa78749aa 100644 --- a/compiler/GHC/ByteCode/Instr.hs +++ b/compiler/GHC/ByteCode/Instr.hs @@ -11,15 +11,15 @@ module GHC.ByteCode.Instr ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.ByteCode.Types import GHCi.RemoteTypes import GHCi.FFI (C_ffi_cif) import GHC.StgToCmm.Layout ( ArgRep(..) ) import GHC.Core.Ppr -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Name import GHC.Types.Unique import GHC.Types.Id diff --git a/compiler/GHC/ByteCode/Linker.hs b/compiler/GHC/ByteCode/Linker.hs index 9ad218e35e..3b61d1f889 100644 --- a/compiler/GHC/ByteCode/Linker.hs +++ b/compiler/GHC/ByteCode/Linker.hs @@ -18,7 +18,7 @@ module GHC.ByteCode.Linker ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHCi.RemoteTypes import GHCi.ResolvedBCO @@ -32,10 +32,10 @@ import GHC.Types.Name import GHC.Types.Name.Env import GHC.Builtin.PrimOps import GHC.Types.Module -import FastString -import Panic -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Panic +import GHC.Utils.Outputable +import GHC.Utils.Misc -- Standard libraries import Data.Array.Unboxed diff --git a/compiler/GHC/ByteCode/Types.hs b/compiler/GHC/ByteCode/Types.hs index 7073da63c2..55ad604447 100644 --- a/compiler/GHC/ByteCode/Types.hs +++ b/compiler/GHC/ByteCode/Types.hs @@ -13,13 +13,13 @@ module GHC.ByteCode.Types , CCostCentre ) where -import GhcPrelude +import GHC.Prelude -import FastString +import GHC.Data.FastString import GHC.Types.Id import GHC.Types.Name import GHC.Types.Name.Env -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.PrimOps import SizedSeq import GHC.Core.Type diff --git a/compiler/GHC/Cmm.hs b/compiler/GHC/Cmm.hs index fe5109aa6f..48ffd25f1b 100644 --- a/compiler/GHC/Cmm.hs +++ b/compiler/GHC/Cmm.hs @@ -28,7 +28,7 @@ module GHC.Cmm ( module GHC.Cmm.Expr, ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Id import GHC.Types.CostCentre @@ -41,7 +41,7 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label -import Outputable +import GHC.Utils.Outputable import Data.ByteString (ByteString) ----------------------------------------------------------------------------- diff --git a/compiler/GHC/Cmm/BlockId.hs b/compiler/GHC/Cmm/BlockId.hs index e458c29902..e6396c8e83 100644 --- a/compiler/GHC/Cmm/BlockId.hs +++ b/compiler/GHC/Cmm/BlockId.hs @@ -8,7 +8,7 @@ module GHC.Cmm.BlockId , blockLbl, infoTblLbl ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.CLabel import GHC.Types.Id.Info diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs index c6969be7ca..af1d7a6e98 100644 --- a/compiler/GHC/Cmm/CLabel.hs +++ b/compiler/GHC/Cmm/CLabel.hs @@ -114,7 +114,7 @@ module GHC.Cmm.CLabel ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Id.Info import GHC.Types.Basic @@ -125,12 +125,12 @@ import GHC.Types.Name import GHC.Types.Unique import GHC.Builtin.PrimOps import GHC.Types.CostCentre -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Driver.Session import GHC.Platform import GHC.Types.Unique.Set -import Util +import GHC.Utils.Misc import GHC.Core.Ppr ( {- instances -} ) import GHC.CmmToAsm.Config diff --git a/compiler/GHC/Cmm/CallConv.hs b/compiler/GHC/Cmm/CallConv.hs index 6cd66be30c..35f63661fa 100644 --- a/compiler/GHC/Cmm/CallConv.hs +++ b/compiler/GHC/Cmm/CallConv.hs @@ -5,7 +5,7 @@ module GHC.Cmm.CallConv ( realArgRegsCover ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.Expr import GHC.Runtime.Heap.Layout @@ -14,7 +14,7 @@ import GHC.Cmm.Ppr () -- For Outputable instances import GHC.Driver.Session import GHC.Platform -import Outputable +import GHC.Utils.Outputable -- Calculate the 'GlobalReg' or stack locations for function call -- parameters as used by the Cmm calling convention. diff --git a/compiler/GHC/Cmm/CommonBlockElim.hs b/compiler/GHC/Cmm/CommonBlockElim.hs index 575e041e73..cc6cb2d40b 100644 --- a/compiler/GHC/Cmm/CommonBlockElim.hs +++ b/compiler/GHC/Cmm/CommonBlockElim.hs @@ -6,7 +6,7 @@ module GHC.Cmm.CommonBlockElim where -import GhcPrelude hiding (iterate, succ, unzip, zip) +import GHC.Prelude hiding (iterate, succ, unzip, zip) import GHC.Cmm.BlockId import GHC.Cmm @@ -23,8 +23,8 @@ import Data.Maybe (mapMaybe) import qualified Data.List as List import Data.Word import qualified Data.Map as M -import Outputable -import qualified TrieMap as TM +import GHC.Utils.Outputable +import qualified GHC.Data.TrieMap as TM import GHC.Types.Unique.FM import GHC.Types.Unique import Control.Arrow (first, second) diff --git a/compiler/GHC/Cmm/ContFlowOpt.hs b/compiler/GHC/Cmm/ContFlowOpt.hs index 1e5459f460..73c13d2040 100644 --- a/compiler/GHC/Cmm/ContFlowOpt.hs +++ b/compiler/GHC/Cmm/ContFlowOpt.hs @@ -10,7 +10,7 @@ module GHC.Cmm.ContFlowOpt ) where -import GhcPrelude hiding (succ, unzip, zip) +import GHC.Prelude hiding (succ, unzip, zip) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Collections @@ -20,9 +20,9 @@ import GHC.Cmm.BlockId import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.Switch (mapSwitchTargets, switchTargetsToList) -import Maybes -import Panic -import Util +import GHC.Data.Maybe +import GHC.Utils.Panic +import GHC.Utils.Misc import Control.Monad diff --git a/compiler/GHC/Cmm/Dataflow.hs b/compiler/GHC/Cmm/Dataflow.hs index d697240191..05a91fe649 100644 --- a/compiler/GHC/Cmm/Dataflow.hs +++ b/compiler/GHC/Cmm/Dataflow.hs @@ -34,7 +34,7 @@ module GHC.Cmm.Dataflow ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm import GHC.Types.Unique.Supply diff --git a/compiler/GHC/Cmm/Dataflow/Block.hs b/compiler/GHC/Cmm/Dataflow/Block.hs index ac567ca605..1fa8d4dfd6 100644 --- a/compiler/GHC/Cmm/Dataflow/Block.hs +++ b/compiler/GHC/Cmm/Dataflow/Block.hs @@ -38,7 +38,7 @@ module GHC.Cmm.Dataflow.Block , replaceLastNode ) where -import GhcPrelude +import GHC.Prelude -- ----------------------------------------------------------------------------- -- Shapes: Open and Closed diff --git a/compiler/GHC/Cmm/Dataflow/Collections.hs b/compiler/GHC/Cmm/Dataflow/Collections.hs index bb762bf698..1fb8f5d52c 100644 --- a/compiler/GHC/Cmm/Dataflow/Collections.hs +++ b/compiler/GHC/Cmm/Dataflow/Collections.hs @@ -12,7 +12,7 @@ module GHC.Cmm.Dataflow.Collections , UniqueMap, UniqueSet ) where -import GhcPrelude +import GHC.Prelude import qualified Data.IntMap.Strict as M import qualified Data.IntSet as S diff --git a/compiler/GHC/Cmm/Dataflow/Graph.hs b/compiler/GHC/Cmm/Dataflow/Graph.hs index de146c6a35..3fbdae85ec 100644 --- a/compiler/GHC/Cmm/Dataflow/Graph.hs +++ b/compiler/GHC/Cmm/Dataflow/Graph.hs @@ -20,8 +20,8 @@ module GHC.Cmm.Dataflow.Graph ) where -import GhcPrelude -import Util +import GHC.Prelude +import GHC.Utils.Misc import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Block diff --git a/compiler/GHC/Cmm/Dataflow/Label.hs b/compiler/GHC/Cmm/Dataflow/Label.hs index 70027570d3..a63cc63ed8 100644 --- a/compiler/GHC/Cmm/Dataflow/Label.hs +++ b/compiler/GHC/Cmm/Dataflow/Label.hs @@ -13,15 +13,15 @@ module GHC.Cmm.Dataflow.Label , mkHooplLabel ) where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable -- TODO: This should really just use GHC's Unique and Uniq{Set,FM} import GHC.Cmm.Dataflow.Collections import GHC.Types.Unique (Uniquable(..)) -import TrieMap +import GHC.Data.TrieMap ----------------------------------------------------------------------------- diff --git a/compiler/GHC/Cmm/DebugBlock.hs b/compiler/GHC/Cmm/DebugBlock.hs index 99650e01ed..a3a7566a8b 100644 --- a/compiler/GHC/Cmm/DebugBlock.hs +++ b/compiler/GHC/Cmm/DebugBlock.hs @@ -25,7 +25,7 @@ module GHC.Cmm.DebugBlock ( UnwindExpr(..), toUnwindExpr ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.BlockId @@ -33,12 +33,12 @@ import GHC.Cmm.CLabel import GHC.Cmm import GHC.Cmm.Utils import GHC.Core -import FastString ( nilFS, mkFastString ) +import GHC.Data.FastString ( nilFS, mkFastString ) import GHC.Types.Module -import Outputable +import GHC.Utils.Outputable import GHC.Cmm.Ppr.Expr ( pprExpr ) import GHC.Types.SrcLoc -import Util ( seqList ) +import GHC.Utils.Misc ( seqList ) import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Collections diff --git a/compiler/GHC/Cmm/Expr.hs b/compiler/GHC/Cmm/Expr.hs index bb3fe2e202..43d6734633 100644 --- a/compiler/GHC/Cmm/Expr.hs +++ b/compiler/GHC/Cmm/Expr.hs @@ -31,7 +31,7 @@ module GHC.Cmm.Expr ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.BlockId @@ -39,7 +39,7 @@ import GHC.Cmm.CLabel import GHC.Cmm.MachOp import GHC.Cmm.Type import GHC.Driver.Session -import Outputable (panic) +import GHC.Utils.Outputable (panic) import GHC.Types.Unique import Data.Set (Set) diff --git a/compiler/GHC/Cmm/Graph.hs b/compiler/GHC/Cmm/Graph.hs index 01fa4dc955..edf51d8b7f 100644 --- a/compiler/GHC/Cmm/Graph.hs +++ b/compiler/GHC/Cmm/Graph.hs @@ -21,7 +21,7 @@ module GHC.Cmm.Graph ) where -import GhcPrelude hiding ( (<*>) ) -- avoid importing (<*>) +import GHC.Prelude hiding ( (<*>) ) -- avoid importing (<*>) import GHC.Cmm.BlockId import GHC.Cmm @@ -32,13 +32,13 @@ import GHC.Cmm.Dataflow.Block import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import OrdList +import GHC.Data.OrdList import GHC.Runtime.Heap.Layout (ByteOff) import GHC.Types.Unique.Supply -import Util -import Panic +import GHC.Utils.Misc +import GHC.Utils.Panic ----------------------------------------------------------------------------- diff --git a/compiler/GHC/Cmm/Info.hs b/compiler/GHC/Cmm/Info.hs index 4ccd06adac..0c0fc98eb6 100644 --- a/compiler/GHC/Cmm/Info.hs +++ b/compiler/GHC/Cmm/Info.hs @@ -33,26 +33,26 @@ module GHC.Cmm.Info ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.CLabel import GHC.Runtime.Heap.Layout import GHC.Data.Bitmap -import Stream (Stream) -import qualified Stream +import GHC.Data.Stream (Stream) +import qualified GHC.Data.Stream as Stream import GHC.Cmm.Dataflow.Collections import GHC.Platform -import Maybes +import GHC.Data.Maybe import GHC.Driver.Session -import ErrUtils (withTimingSilent) -import Panic +import GHC.Utils.Error (withTimingSilent) +import GHC.Utils.Panic import GHC.Types.Unique.Supply -import MonadUtils -import Util -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Misc +import GHC.Utils.Outputable import Data.ByteString (ByteString) import Data.Bits diff --git a/compiler/GHC/Cmm/Info/Build.hs b/compiler/GHC/Cmm/Info/Build.hs index 8ee009f638..bf936d41d9 100644 --- a/compiler/GHC/Cmm/Info/Build.hs +++ b/compiler/GHC/Cmm/Info/Build.hs @@ -8,7 +8,7 @@ module GHC.Cmm.Info.Build , SRTMap, srtMapNonCAFs ) where -import GhcPrelude hiding (succ) +import GHC.Prelude hiding (succ) import GHC.Types.Id import GHC.Types.Id.Info @@ -20,13 +20,13 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow import GHC.Types.Module import GHC.Platform -import Digraph +import GHC.Data.Graph.Directed import GHC.Cmm.CLabel import GHC.Cmm import GHC.Cmm.Utils import GHC.Driver.Session -import Maybes -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Outputable import GHC.Runtime.Heap.Layout import GHC.Types.Unique.Supply import GHC.Types.CostCentre diff --git a/compiler/GHC/Cmm/LayoutStack.hs b/compiler/GHC/Cmm/LayoutStack.hs index 4cf7fcfdc1..232ab7934d 100644 --- a/compiler/GHC/Cmm/LayoutStack.hs +++ b/compiler/GHC/Cmm/LayoutStack.hs @@ -3,7 +3,7 @@ module GHC.Cmm.LayoutStack ( cmmLayoutStack, setInfoTableStackMap ) where -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import GHC.StgToCmm.Utils ( callerSaveVolatileRegs, newTemp ) -- XXX layering violation import GHC.StgToCmm.Foreign ( saveThreadState, loadThreadState ) -- XXX layering violation @@ -25,14 +25,14 @@ import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Label import GHC.Types.Unique.Supply -import Maybes +import GHC.Data.Maybe import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import GHC.Platform import GHC.Driver.Session -import FastString -import Outputable hiding ( isEmpty ) +import GHC.Data.FastString +import GHC.Utils.Outputable hiding ( isEmpty ) import qualified Data.Set as Set import Control.Monad.Fix import Data.Array as Array diff --git a/compiler/GHC/Cmm/Lexer.x b/compiler/GHC/Cmm/Lexer.x index d0fca50bd3..010001cd2a 100644 --- a/compiler/GHC/Cmm/Lexer.x +++ b/compiler/GHC/Cmm/Lexer.x @@ -15,7 +15,7 @@ module GHC.Cmm.Lexer ( CmmToken(..), cmmlex, ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.Expr @@ -23,10 +23,10 @@ import GHC.Parser.Lexer import GHC.Cmm.Monad import GHC.Types.SrcLoc import GHC.Types.Unique.FM -import StringBuffer -import FastString +import GHC.Data.StringBuffer +import GHC.Data.FastString import GHC.Parser.CharClass -import Util +import GHC.Utils.Misc --import TRACE import Data.Word diff --git a/compiler/GHC/Cmm/Lint.hs b/compiler/GHC/Cmm/Lint.hs index 3a96e82054..aa3e3a896e 100644 --- a/compiler/GHC/Cmm/Lint.hs +++ b/compiler/GHC/Cmm/Lint.hs @@ -11,7 +11,7 @@ module GHC.Cmm.Lint ( cmmLint, cmmLintGraph ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.Dataflow.Block @@ -23,7 +23,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Liveness import GHC.Cmm.Switch (switchTargetsToList) import GHC.Cmm.Ppr () -- For Outputable instances -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session import Control.Monad (ap) diff --git a/compiler/GHC/Cmm/Liveness.hs b/compiler/GHC/Cmm/Liveness.hs index 10d4ca8dfd..c229e48529 100644 --- a/compiler/GHC/Cmm/Liveness.hs +++ b/compiler/GHC/Cmm/Liveness.hs @@ -12,7 +12,7 @@ module GHC.Cmm.Liveness ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Cmm.BlockId @@ -23,8 +23,8 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow import GHC.Cmm.Dataflow.Label -import Maybes -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Outputable ----------------------------------------------------------------------------- -- Calculating what variables are live on entry to a basic block diff --git a/compiler/GHC/Cmm/MachOp.hs b/compiler/GHC/Cmm/MachOp.hs index f1a1e9b699..1b3dd2a531 100644 --- a/compiler/GHC/Cmm/MachOp.hs +++ b/compiler/GHC/Cmm/MachOp.hs @@ -28,11 +28,11 @@ module GHC.Cmm.MachOp ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.Type -import Outputable +import GHC.Utils.Outputable ----------------------------------------------------------------------------- -- MachOp diff --git a/compiler/GHC/Cmm/Monad.hs b/compiler/GHC/Cmm/Monad.hs index d97df7719e..27cf51af4f 100644 --- a/compiler/GHC/Cmm/Monad.hs +++ b/compiler/GHC/Cmm/Monad.hs @@ -13,7 +13,7 @@ module GHC.Cmm.Monad ( , failMsgPD ) where -import GhcPrelude +import GHC.Prelude import Control.Monad diff --git a/compiler/GHC/Cmm/Node.hs b/compiler/GHC/Cmm/Node.hs index d5d020ee00..5e13483fae 100644 --- a/compiler/GHC/Cmm/Node.hs +++ b/compiler/GHC/Cmm/Node.hs @@ -26,15 +26,15 @@ module GHC.Cmm.Node ( CmmTickScope(..), isTickSubScope, combineTickScopes, ) where -import GhcPrelude hiding (succ) +import GHC.Prelude hiding (succ) import GHC.Platform.Regs import GHC.Cmm.Expr import GHC.Cmm.Switch import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import Outputable +import GHC.Utils.Outputable import GHC.Runtime.Heap.Layout import GHC.Core (Tickish) import qualified GHC.Types.Unique as U @@ -46,7 +46,7 @@ import GHC.Cmm.Dataflow.Label import Data.Maybe import Data.List (tails,sortBy) import GHC.Types.Unique (nonDetCmpUnique) -import Util +import GHC.Utils.Misc ------------------------ diff --git a/compiler/GHC/Cmm/Opt.hs b/compiler/GHC/Cmm/Opt.hs index a217f71c47..4ac24523c1 100644 --- a/compiler/GHC/Cmm/Opt.hs +++ b/compiler/GHC/Cmm/Opt.hs @@ -13,13 +13,13 @@ module GHC.Cmm.Opt ( cmmMachOpFoldM ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.Utils import GHC.Cmm -import Util +import GHC.Utils.Misc -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Bits diff --git a/compiler/GHC/Cmm/Parser.y b/compiler/GHC/Cmm/Parser.y index 9ff637de70..7da85271f6 100644 --- a/compiler/GHC/Cmm/Parser.y +++ b/compiler/GHC/Cmm/Parser.y @@ -202,7 +202,7 @@ necessary to the stack to accommodate it (e.g. 2). module GHC.Cmm.Parser ( parseCmmFile ) where -import GhcPrelude +import GHC.Prelude import GHC.StgToCmm.ExtCode import GHC.Cmm.CallConv @@ -243,14 +243,14 @@ import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.SrcLoc import GHC.Driver.Session -import ErrUtils -import StringBuffer -import FastString -import Panic +import GHC.Utils.Error +import GHC.Data.StringBuffer +import GHC.Data.FastString +import GHC.Utils.Panic import GHC.Settings.Constants -import Outputable +import GHC.Utils.Outputable import GHC.Types.Basic -import Bag ( emptyBag, unitBag ) +import GHC.Data.Bag ( emptyBag, unitBag ) import GHC.Types.Var import Control.Monad diff --git a/compiler/GHC/Cmm/Pipeline.hs b/compiler/GHC/Cmm/Pipeline.hs index e730cfda40..8d8deac91d 100644 --- a/compiler/GHC/Cmm/Pipeline.hs +++ b/compiler/GHC/Cmm/Pipeline.hs @@ -9,7 +9,7 @@ module GHC.Cmm.Pipeline ( cmmPipeline ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm import GHC.Cmm.Lint @@ -24,10 +24,10 @@ import GHC.Cmm.Dataflow.Collections import GHC.Types.Unique.Supply import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Types import Control.Monad -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Either (partitionEithers) diff --git a/compiler/GHC/Cmm/Ppr.hs b/compiler/GHC/Cmm/Ppr.hs index d37b960c80..91bdfb40aa 100644 --- a/compiler/GHC/Cmm/Ppr.hs +++ b/compiler/GHC/Cmm/Ppr.hs @@ -40,7 +40,7 @@ module GHC.Cmm.Ppr ) where -import GhcPrelude hiding (succ) +import GHC.Prelude hiding (succ) import GHC.Platform import GHC.Driver.Session (targetPlatform) @@ -48,11 +48,11 @@ import GHC.Cmm.CLabel import GHC.Cmm import GHC.Cmm.Utils import GHC.Cmm.Switch -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Cmm.Ppr.Decl import GHC.Cmm.Ppr.Expr -import Util +import GHC.Utils.Misc import GHC.Types.Basic import GHC.Cmm.Dataflow.Block diff --git a/compiler/GHC/Cmm/Ppr/Decl.hs b/compiler/GHC/Cmm/Ppr/Decl.hs index d6ec1882b2..43a341bf85 100644 --- a/compiler/GHC/Cmm/Ppr/Decl.hs +++ b/compiler/GHC/Cmm/Ppr/Decl.hs @@ -40,15 +40,15 @@ module GHC.Cmm.Ppr.Decl ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.Ppr.Expr import GHC.Cmm import GHC.Driver.Session -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import Data.List import System.IO diff --git a/compiler/GHC/Cmm/Ppr/Expr.hs b/compiler/GHC/Cmm/Ppr/Expr.hs index 9e25ededf6..fb8e158a2d 100644 --- a/compiler/GHC/Cmm/Ppr/Expr.hs +++ b/compiler/GHC/Cmm/Ppr/Expr.hs @@ -39,13 +39,13 @@ module GHC.Cmm.Ppr.Expr ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Driver.Session (targetPlatform) import GHC.Cmm.Expr -import Outputable +import GHC.Utils.Outputable import Data.Maybe import Numeric ( fromRat ) diff --git a/compiler/GHC/Cmm/ProcPoint.hs b/compiler/GHC/Cmm/ProcPoint.hs index 9017c0eb0c..f9dc3a8334 100644 --- a/compiler/GHC/Cmm/ProcPoint.hs +++ b/compiler/GHC/Cmm/ProcPoint.hs @@ -9,7 +9,7 @@ module GHC.Cmm.ProcPoint ) where -import GhcPrelude hiding (last, unzip, succ, zip) +import GHC.Prelude hiding (last, unzip, succ, zip) import GHC.Driver.Session import GHC.Cmm.BlockId @@ -21,9 +21,9 @@ import GHC.Cmm.Info import GHC.Cmm.Liveness import GHC.Cmm.Switch import Data.List (sortBy) -import Maybes +import GHC.Data.Maybe import Control.Monad -import Outputable +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique.Supply import GHC.Cmm.Dataflow.Block diff --git a/compiler/GHC/Cmm/Sink.hs b/compiler/GHC/Cmm/Sink.hs index 3ca4fe9c75..8c32ab01aa 100644 --- a/compiler/GHC/Cmm/Sink.hs +++ b/compiler/GHC/Cmm/Sink.hs @@ -3,7 +3,7 @@ module GHC.Cmm.Sink ( cmmSink ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm import GHC.Cmm.Opt diff --git a/compiler/GHC/Cmm/Switch.hs b/compiler/GHC/Cmm/Switch.hs index f297bd8b5e..b8d7456b37 100644 --- a/compiler/GHC/Cmm/Switch.hs +++ b/compiler/GHC/Cmm/Switch.hs @@ -12,9 +12,9 @@ module GHC.Cmm.Switch ( createSwitchPlan, ) where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session import GHC.Cmm.Dataflow.Label (Label) diff --git a/compiler/GHC/Cmm/Switch/Implement.hs b/compiler/GHC/Cmm/Switch/Implement.hs index b098917711..3279c5ab05 100644 --- a/compiler/GHC/Cmm/Switch/Implement.hs +++ b/compiler/GHC/Cmm/Switch/Implement.hs @@ -4,7 +4,7 @@ module GHC.Cmm.Switch.Implement ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.Dataflow.Block @@ -14,7 +14,7 @@ import GHC.Cmm.Utils import GHC.Cmm.Switch import GHC.Types.Unique.Supply import GHC.Driver.Session -import MonadUtils (concatMapM) +import GHC.Utils.Monad (concatMapM) -- -- This module replaces Switch statements as generated by the Stg -> Cmm diff --git a/compiler/GHC/Cmm/Type.hs b/compiler/GHC/Cmm/Type.hs index fced2bf076..bddc933bf1 100644 --- a/compiler/GHC/Cmm/Type.hs +++ b/compiler/GHC/Cmm/Type.hs @@ -29,12 +29,12 @@ module GHC.Cmm.Type where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Driver.Session -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import Data.Word import Data.Int diff --git a/compiler/GHC/Cmm/Utils.hs b/compiler/GHC/Cmm/Utils.hs index c23975bb44..a49557a07e 100644 --- a/compiler/GHC/Cmm/Utils.hs +++ b/compiler/GHC/Cmm/Utils.hs @@ -71,7 +71,7 @@ module GHC.Cmm.Utils( blockTicks ) where -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCon ( PrimRep(..), PrimElemRep(..) ) import GHC.Types.RepType ( UnaryType, SlotTy (..), typePrimRep1 ) @@ -81,7 +81,7 @@ import GHC.Runtime.Heap.Layout import GHC.Cmm import GHC.Cmm.BlockId import GHC.Cmm.CLabel -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session import GHC.Types.Unique import GHC.Platform.Regs diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs index 56ac9ceaf5..374b6c47e8 100644 --- a/compiler/GHC/CmmToAsm.hs +++ b/compiler/GHC/CmmToAsm.hs @@ -30,7 +30,7 @@ module GHC.CmmToAsm ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import qualified GHC.CmmToAsm.X86.CodeGen as X86.CodeGen import qualified GHC.CmmToAsm.X86.Regs as X86.Regs @@ -53,12 +53,12 @@ import qualified GHC.CmmToAsm.PPC.Ppr as PPC.Ppr import GHC.CmmToAsm.Reg.Liveness import qualified GHC.CmmToAsm.Reg.Linear as Linear -import qualified GraphColor as Color +import qualified GHC.Data.Graph.Color as Color import qualified GHC.CmmToAsm.Reg.Graph as Color import qualified GHC.CmmToAsm.Reg.Graph.Stats as Color import qualified GHC.CmmToAsm.Reg.Graph.TrivColorable as Color -import AsmUtils +import GHC.Utils.Asm import GHC.CmmToAsm.Reg.Target import GHC.Platform import GHC.CmmToAsm.BlockLayout as BlockLayout @@ -86,21 +86,21 @@ import GHC.Cmm.CLabel import GHC.Types.Unique.FM import GHC.Types.Unique.Supply import GHC.Driver.Session -import Util +import GHC.Utils.Misc import GHC.Types.Basic ( Alignment ) -import qualified Pretty -import BufWrite -import Outputable -import FastString +import qualified GHC.Utils.Ppr as Pretty +import GHC.Utils.BufHandle +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString import GHC.Types.Unique.Set -import ErrUtils +import GHC.Utils.Error import GHC.Types.Module -import Stream (Stream) -import qualified Stream +import GHC.Data.Stream (Stream) +import qualified GHC.Data.Stream as Stream -- DEBUGGING ONLY ---import OrdList +--import GHC.Data.OrdList import Data.List import Data.Maybe diff --git a/compiler/GHC/CmmToAsm/BlockLayout.hs b/compiler/GHC/CmmToAsm/BlockLayout.hs index 7ff90e8c40..07faa91473 100644 --- a/compiler/GHC/CmmToAsm/BlockLayout.hs +++ b/compiler/GHC/CmmToAsm/BlockLayout.hs @@ -14,7 +14,7 @@ module GHC.CmmToAsm.BlockLayout where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Instr import GHC.CmmToAsm.Monad @@ -28,19 +28,19 @@ import GHC.Cmm.Dataflow.Label import GHC.Platform import GHC.Driver.Session (gopt, GeneralFlag(..), DynFlags, targetPlatform) import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import GHC.Types.Unique -import Digraph -import Outputable -import Maybes +import GHC.Data.Graph.Directed +import GHC.Utils.Outputable +import GHC.Data.Maybe -- DEBUGGING ONLY --import GHC.Cmm.DebugBlock --import Debug.Trace -import ListSetOps (removeDups) +import GHC.Data.List.SetOps (removeDups) -import OrdList +import GHC.Data.OrdList import Data.List import Data.Foldable (toList) diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index dca02b0eb5..ad3a3cdae7 100644 --- a/compiler/GHC/CmmToAsm/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -44,7 +44,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Cmm.BlockId import GHC.Cmm as Cmm @@ -56,9 +56,9 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Block import qualified GHC.Cmm.Dataflow.Graph as G -import Util -import Digraph -import Maybes +import GHC.Utils.Misc +import GHC.Data.Graph.Directed +import GHC.Data.Maybe import GHC.Types.Unique import qualified GHC.CmmToAsm.CFG.Dominators as Dom @@ -72,10 +72,10 @@ import qualified Data.Set as S import Data.Tree import Data.Bifunctor -import Outputable +import GHC.Utils.Outputable -- DEBUGGING ONLY --import GHC.Cmm.DebugBlock ---import OrdList +--import GHC.Data.OrdList --import GHC.Cmm.DebugBlock.Trace import GHC.Cmm.Ppr () -- For Outputable instances import qualified GHC.Driver.Session as D diff --git a/compiler/GHC/CmmToAsm/CFG/Dominators.hs b/compiler/GHC/CmmToAsm/CFG/Dominators.hs index b9dcacd8cb..bb28e877d7 100644 --- a/compiler/GHC/CmmToAsm/CFG/Dominators.hs +++ b/compiler/GHC/CmmToAsm/CFG/Dominators.hs @@ -38,7 +38,7 @@ module GHC.CmmToAsm.CFG.Dominators ( ,parents,ancestors
) where
-import GhcPrelude
+import GHC.Prelude
import Data.Bifunctor
import Data.Tuple (swap)
@@ -58,7 +58,7 @@ import Data.Array.Base hiding ((!)) -- ,unsafeWrite,unsafeRead
-- ,readArray,writeArray)
-import Util (debugIsOn)
+import GHC.Utils.Misc (debugIsOn)
-----------------------------------------------------------------------------
diff --git a/compiler/GHC/CmmToAsm/CPrim.hs b/compiler/GHC/CmmToAsm/CPrim.hs index 34c3a7ff6a..fc2d06262b 100644 --- a/compiler/GHC/CmmToAsm/CPrim.hs +++ b/compiler/GHC/CmmToAsm/CPrim.hs @@ -14,11 +14,11 @@ module GHC.CmmToAsm.CPrim , word2FloatLabel ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.Type import GHC.Cmm.MachOp -import Outputable +import GHC.Utils.Outputable popCntLabel :: Width -> String popCntLabel w = "hs_popcnt" ++ pprWidth w diff --git a/compiler/GHC/CmmToAsm/Config.hs b/compiler/GHC/CmmToAsm/Config.hs index 52c0995bdf..cbd15d0580 100644 --- a/compiler/GHC/CmmToAsm/Config.hs +++ b/compiler/GHC/CmmToAsm/Config.hs @@ -6,7 +6,7 @@ module GHC.CmmToAsm.Config ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Cmm.Type (Width(..)) import GHC.Types.Module diff --git a/compiler/GHC/CmmToAsm/Dwarf.hs b/compiler/GHC/CmmToAsm/Dwarf.hs index 8075bdd27e..bc5e82c316 100644 --- a/compiler/GHC/CmmToAsm/Dwarf.hs +++ b/compiler/GHC/CmmToAsm/Dwarf.hs @@ -2,7 +2,7 @@ module GHC.CmmToAsm.Dwarf ( dwarfGen ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.CLabel import GHC.Cmm.Expr ( GlobalReg(..) ) @@ -11,7 +11,7 @@ import GHC.Core ( Tickish(..) ) import GHC.Cmm.DebugBlock import GHC.Driver.Session import GHC.Types.Module -import Outputable +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique import GHC.Types.Unique.Supply diff --git a/compiler/GHC/CmmToAsm/Dwarf/Constants.hs b/compiler/GHC/CmmToAsm/Dwarf/Constants.hs index 29592c106e..e550813be1 100644 --- a/compiler/GHC/CmmToAsm/Dwarf/Constants.hs +++ b/compiler/GHC/CmmToAsm/Dwarf/Constants.hs @@ -3,12 +3,12 @@ module GHC.CmmToAsm.Dwarf.Constants where -import GhcPrelude +import GHC.Prelude -import AsmUtils -import FastString +import GHC.Utils.Asm +import GHC.Data.FastString import GHC.Platform -import Outputable +import GHC.Utils.Outputable import GHC.Platform.Reg import GHC.CmmToAsm.X86.Regs diff --git a/compiler/GHC/CmmToAsm/Dwarf/Types.hs b/compiler/GHC/CmmToAsm/Dwarf/Types.hs index eaeb570595..41c0dd518d 100644 --- a/compiler/GHC/CmmToAsm/Dwarf/Types.hs +++ b/compiler/GHC/CmmToAsm/Dwarf/Types.hs @@ -22,19 +22,19 @@ module GHC.CmmToAsm.Dwarf.Types ) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.DebugBlock import GHC.Cmm.CLabel import GHC.Cmm.Expr ( GlobalReg(..) ) -import Encoding -import FastString -import Outputable +import GHC.Utils.Encoding +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique import GHC.Platform.Reg import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc import GHC.CmmToAsm.Dwarf.Constants diff --git a/compiler/GHC/CmmToAsm/Format.hs b/compiler/GHC/CmmToAsm/Format.hs index 446c760939..0049d2c987 100644 --- a/compiler/GHC/CmmToAsm/Format.hs +++ b/compiler/GHC/CmmToAsm/Format.hs @@ -20,10 +20,10 @@ module GHC.CmmToAsm.Format ( where -import GhcPrelude +import GHC.Prelude import GHC.Cmm -import Outputable +import GHC.Utils.Outputable -- It looks very like the old MachRep, but it's now of purely local -- significance, here in the native code generator. You can change it diff --git a/compiler/GHC/CmmToAsm/Instr.hs b/compiler/GHC/CmmToAsm/Instr.hs index 01f703340b..833a72a74a 100644 --- a/compiler/GHC/CmmToAsm/Instr.hs +++ b/compiler/GHC/CmmToAsm/Instr.hs @@ -14,7 +14,7 @@ module GHC.CmmToAsm.Instr ( where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Platform.Reg diff --git a/compiler/GHC/CmmToAsm/Monad.hs b/compiler/GHC/CmmToAsm/Monad.hs index 07c3cc809b..9d5cf246c2 100644 --- a/compiler/GHC/CmmToAsm/Monad.hs +++ b/compiler/GHC/CmmToAsm/Monad.hs @@ -46,7 +46,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Platform.Reg @@ -59,7 +59,7 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Label import GHC.Cmm.CLabel ( CLabel ) import GHC.Cmm.DebugBlock -import FastString ( FastString ) +import GHC.Data.FastString ( FastString ) import GHC.Types.Unique.FM import GHC.Types.Unique.Supply import GHC.Types.Unique ( Unique ) @@ -69,7 +69,7 @@ import GHC.Types.Module import Control.Monad ( ap ) import GHC.CmmToAsm.Instr -import Outputable (SDoc, pprPanic, ppr) +import GHC.Utils.Outputable (SDoc, pprPanic, ppr) import GHC.Cmm (RawCmmDecl, RawCmmStatics) import GHC.CmmToAsm.CFG diff --git a/compiler/GHC/CmmToAsm/PIC.hs b/compiler/GHC/CmmToAsm/PIC.hs index d60821ee10..5b237fc7db 100644 --- a/compiler/GHC/CmmToAsm/PIC.hs +++ b/compiler/GHC/CmmToAsm/PIC.hs @@ -47,7 +47,7 @@ module GHC.CmmToAsm.PIC ( where -import GhcPrelude +import GHC.Prelude import qualified GHC.CmmToAsm.PPC.Instr as PPC import qualified GHC.CmmToAsm.PPC.Regs as PPC @@ -73,10 +73,10 @@ import GHC.Cmm.CLabel ( mkForeignLabel ) import GHC.Types.Basic import GHC.Types.Module -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session -import FastString +import GHC.Data.FastString diff --git a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs index 16557dba71..764945c2bc 100644 --- a/compiler/GHC/CmmToAsm/PPC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/PPC/CodeGen.hs @@ -23,7 +23,7 @@ where #include "HsVersions.h" -- NCG stuff: -import GhcPrelude +import GHC.Prelude import GHC.Platform.Regs import GHC.CmmToAsm.PPC.Instr @@ -60,16 +60,16 @@ import GHC.Core ( Tickish(..) ) import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) -- The rest: -import OrdList -import Outputable +import GHC.Data.OrdList +import GHC.Utils.Outputable import Control.Monad ( mapAndUnzipM, when ) import Data.Bits import Data.Word import GHC.Types.Basic -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc -- ----------------------------------------------------------------------------- -- Top-level of the instruction selector diff --git a/compiler/GHC/CmmToAsm/PPC/Cond.hs b/compiler/GHC/CmmToAsm/PPC/Cond.hs index e8efa30064..a8f7aac877 100644 --- a/compiler/GHC/CmmToAsm/PPC/Cond.hs +++ b/compiler/GHC/CmmToAsm/PPC/Cond.hs @@ -8,9 +8,9 @@ module GHC.CmmToAsm.PPC.Cond ( where -import GhcPrelude +import GHC.Prelude -import Panic +import GHC.Utils.Panic data Cond = ALWAYS diff --git a/compiler/GHC/CmmToAsm/PPC/Instr.hs b/compiler/GHC/CmmToAsm/PPC/Instr.hs index 674b19ef93..26c50bcdc8 100644 --- a/compiler/GHC/CmmToAsm/PPC/Instr.hs +++ b/compiler/GHC/CmmToAsm/PPC/Instr.hs @@ -24,7 +24,7 @@ module GHC.CmmToAsm.PPC.Instr ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.PPC.Regs import GHC.CmmToAsm.PPC.Cond @@ -41,9 +41,9 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Label import GHC.Cmm import GHC.Cmm.Info -import FastString +import GHC.Data.FastString import GHC.Cmm.CLabel -import Outputable +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique.FM (listToUFM, lookupUFM) import GHC.Types.Unique.Supply diff --git a/compiler/GHC/CmmToAsm/PPC/Ppr.hs b/compiler/GHC/CmmToAsm/PPC/Ppr.hs index 15e72bbb49..4ef5437b71 100644 --- a/compiler/GHC/CmmToAsm/PPC/Ppr.hs +++ b/compiler/GHC/CmmToAsm/PPC/Ppr.hs @@ -9,7 +9,7 @@ {-# OPTIONS_GHC -fno-warn-orphans #-} module GHC.CmmToAsm.PPC.Ppr (pprNatCmmDecl) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.PPC.Regs import GHC.CmmToAsm.PPC.Instr @@ -32,8 +32,8 @@ import GHC.Cmm.Ppr.Expr () -- For Outputable instances import GHC.Types.Unique ( pprUniqueAlways, getUnique ) import GHC.Platform -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Driver.Session (targetPlatform) import Data.Word diff --git a/compiler/GHC/CmmToAsm/PPC/RegInfo.hs b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs index 58e3f44ece..0e0f1e464d 100644 --- a/compiler/GHC/CmmToAsm/PPC/RegInfo.hs +++ b/compiler/GHC/CmmToAsm/PPC/RegInfo.hs @@ -19,7 +19,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.PPC.Instr @@ -28,7 +28,7 @@ import GHC.Cmm import GHC.Cmm.CLabel import GHC.Types.Unique -import Outputable (ppr, text, Outputable, (<>)) +import GHC.Utils.Outputable (ppr, text, Outputable, (<>)) data JumpDest = DestBlockId BlockId diff --git a/compiler/GHC/CmmToAsm/PPC/Regs.hs b/compiler/GHC/CmmToAsm/PPC/Regs.hs index b37fb400fc..a92c7f00ef 100644 --- a/compiler/GHC/CmmToAsm/PPC/Regs.hs +++ b/compiler/GHC/CmmToAsm/PPC/Regs.hs @@ -50,7 +50,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform.Reg import GHC.Platform.Reg.Class @@ -61,7 +61,7 @@ import GHC.Cmm.CLabel ( CLabel ) import GHC.Types.Unique import GHC.Platform.Regs -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Word ( Word8, Word16, Word32, Word64 ) diff --git a/compiler/GHC/CmmToAsm/Ppr.hs b/compiler/GHC/CmmToAsm/Ppr.hs index c0abb52ad3..405bab9fff 100644 --- a/compiler/GHC/CmmToAsm/Ppr.hs +++ b/compiler/GHC/CmmToAsm/Ppr.hs @@ -21,14 +21,14 @@ module GHC.CmmToAsm.Ppr ( where -import GhcPrelude +import GHC.Prelude -import AsmUtils +import GHC.Utils.Asm import GHC.Cmm.CLabel import GHC.Cmm import GHC.CmmToAsm.Config -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Platform import qualified Data.Array.Unsafe as U ( castSTUArray ) @@ -96,7 +96,7 @@ doubleToBytes d -- Printing ASCII strings. -- -- Print as a string and escape non-printable characters. --- This is similar to charToC in Utils. +-- This is similar to charToC in GHC.Utils.Misc pprASCII :: ByteString -> SDoc pprASCII str diff --git a/compiler/GHC/CmmToAsm/Reg/Graph.hs b/compiler/GHC/CmmToAsm/Reg/Graph.hs index 443072b246..022c9eed4c 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph.hs @@ -5,9 +5,9 @@ module GHC.CmmToAsm.Reg.Graph ( regAlloc ) where -import GhcPrelude +import GHC.Prelude -import qualified GraphColor as Color +import qualified GHC.Data.Graph.Color as Color import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Reg.Graph.Spill import GHC.CmmToAsm.Reg.Graph.SpillClean @@ -20,13 +20,13 @@ import GHC.CmmToAsm.Config import GHC.Platform.Reg.Class import GHC.Platform.Reg -import Bag -import Outputable +import GHC.Data.Bag +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique.FM import GHC.Types.Unique.Set import GHC.Types.Unique.Supply -import Util (seqList) +import GHC.Utils.Misc (seqList) import GHC.CmmToAsm.CFG import Data.Maybe diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs index ba3f825149..86c25c5a24 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs @@ -22,12 +22,12 @@ module GHC.CmmToAsm.Reg.Graph.Base ( squeese ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique -import MonadUtils (concatMapM) +import GHC.Utils.Monad (concatMapM) -- Some basic register classes. diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs index dd28981261..0bdee541ed 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs @@ -3,15 +3,15 @@ module GHC.CmmToAsm.Reg.Graph.Coalesce ( regCoalesce, slurpJoinMovs ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Instr import GHC.Platform.Reg import GHC.Cmm -import Bag -import Digraph +import GHC.Data.Bag +import GHC.Data.Graph.Directed import GHC.Types.Unique.FM import GHC.Types.Unique.Set import GHC.Types.Unique.Supply diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs index 5ae55334a2..4694ba6b96 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs @@ -7,7 +7,7 @@ module GHC.CmmToAsm.Reg.Graph.Spill ( SpillStats(..), accSpillSL ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Instr @@ -16,13 +16,13 @@ import GHC.Cmm hiding (RegSet) import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections -import MonadUtils -import State +import GHC.Utils.Monad +import GHC.Utils.Monad.State import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set import GHC.Types.Unique.Supply -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.List diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs index ac784582e7..c810aeeac4 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/SpillClean.hs @@ -29,7 +29,7 @@ module GHC.CmmToAsm.Reg.Graph.SpillClean ( cleanSpills ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Instr @@ -40,8 +40,8 @@ import GHC.Cmm import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique -import State -import Outputable +import GHC.Utils.Monad.State +import GHC.Utils.Outputable import GHC.Platform import GHC.Cmm.Dataflow.Collections diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs b/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs index 6484a38d79..995b286839 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs @@ -13,24 +13,24 @@ module GHC.CmmToAsm.Reg.Graph.SpillCost ( lifeMapFromSpillCostInfo ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Instr import GHC.Platform.Reg.Class import GHC.Platform.Reg -import GraphBase +import GHC.Data.Graph.Base import GHC.Cmm.Dataflow.Collections (mapLookup) import GHC.Cmm.Dataflow.Label import GHC.Cmm import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import Digraph (flattenSCCs) -import Outputable +import GHC.Data.Graph.Directed (flattenSCCs) +import GHC.Utils.Outputable import GHC.Platform -import State +import GHC.Utils.Monad.State import GHC.CmmToAsm.CFG import Data.List (nub, minimumBy) diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs index a06a22fa05..ddd353c4f2 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Stats.hs @@ -16,9 +16,9 @@ module GHC.CmmToAsm.Reg.Graph.Stats ( countSRMs, addSRM ) where -import GhcPrelude +import GHC.Prelude -import qualified GraphColor as Color +import qualified GHC.Data.Graph.Color as Color import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Reg.Graph.Spill import GHC.CmmToAsm.Reg.Graph.SpillCost @@ -29,10 +29,10 @@ import GHC.Platform.Reg import GHC.CmmToAsm.Reg.Target import GHC.Platform -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import State +import GHC.Utils.Monad.State -- | Holds interesting statistics from the register allocator. data RegAllocStats statics instr diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs index 4cf3d98eb1..0370670b21 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs @@ -8,16 +8,16 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform.Reg.Class import GHC.Platform.Reg -import GraphBase +import GHC.Data.Graph.Base import GHC.Types.Unique.Set import GHC.Platform -import Panic +import GHC.Utils.Panic -- trivColorable --------------------------------------------------------------- diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs b/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs index c673c69c1d..d63cc819ac 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/X86.hs @@ -15,7 +15,7 @@ module GHC.CmmToAsm.Reg.Graph.X86 ( squeese, ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Graph.Base (Reg(..), RegSub(..), RegClass(..)) import GHC.Types.Unique.Set diff --git a/compiler/GHC/CmmToAsm/Reg/Linear.hs b/compiler/GHC/CmmToAsm/Reg/Linear.hs index a093bad83a..00b4915d7b 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear.hs @@ -104,7 +104,7 @@ module GHC.CmmToAsm.Reg.Linear ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Linear.State import GHC.CmmToAsm.Reg.Linear.Base @@ -126,12 +126,12 @@ import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections import GHC.Cmm hiding (RegSet) -import Digraph +import GHC.Data.Graph.Directed import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique.Supply -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Maybe diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs b/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs index 95036adb26..5784660e3f 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/Base.hs @@ -17,14 +17,14 @@ module GHC.CmmToAsm.Reg.Linear.Base ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Linear.StackMap import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Config import GHC.Platform.Reg -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Supply diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs index e340dcf5c6..b4fa0f8b76 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs @@ -9,13 +9,13 @@ module GHC.CmmToAsm.Reg.Linear.FreeRegs ( where -import GhcPrelude +import GHC.Prelude import GHC.Platform.Reg import GHC.Platform.Reg.Class import GHC.CmmToAsm.Config -import Panic +import GHC.Utils.Panic import GHC.Platform -- ----------------------------------------------------------------------------- diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs b/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs index 55735913d4..4ceaf4573b 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs @@ -10,7 +10,7 @@ -- module GHC.CmmToAsm.Reg.Linear.JoinToTargets (joinToTargets) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Linear.State import GHC.CmmToAsm.Reg.Linear.Base @@ -22,8 +22,8 @@ import GHC.Platform.Reg import GHC.Cmm.BlockId import GHC.Cmm.Dataflow.Collections -import Digraph -import Outputable +import GHC.Data.Graph.Directed +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs b/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs index ce0a187647..fe19164357 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs @@ -1,13 +1,13 @@ -- | Free regs map for PowerPC module GHC.CmmToAsm.Reg.Linear.PPC where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.PPC.Regs import GHC.Platform.Reg.Class import GHC.Platform.Reg -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Word diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs b/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs index 7fa85f0913..ac7dc85366 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/SPARC.hs @@ -3,14 +3,14 @@ -- | Free regs map for SPARC module GHC.CmmToAsm.Reg.Linear.SPARC where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Regs import GHC.Platform.Reg.Class import GHC.Platform.Reg import GHC.Platform.Regs -import Outputable +import GHC.Utils.Outputable import GHC.Platform import Data.Word diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs b/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs index c2477fc18f..29864f9752 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs @@ -20,7 +20,7 @@ module GHC.CmmToAsm.Reg.Linear.StackMap ( where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique.FM import GHC.Types.Unique diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs index cf8913e211..f96cc71239 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/State.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/State.hs @@ -38,7 +38,7 @@ module GHC.CmmToAsm.Reg.Linear.State ( ) where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Linear.Stats import GHC.CmmToAsm.Reg.Linear.StackMap diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs b/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs index 84acc3a417..414128b32c 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/Stats.hs @@ -6,16 +6,16 @@ module GHC.CmmToAsm.Reg.Linear.Stats ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Reg.Linear.Base import GHC.CmmToAsm.Reg.Liveness import GHC.CmmToAsm.Instr import GHC.Types.Unique.FM -import Outputable +import GHC.Utils.Outputable -import State +import GHC.Utils.Monad.State -- | Build a map of how many times each reg was alloced, clobbered, loaded etc. binSpillReasons diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs b/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs index ce103bd6b2..ae37b0f9d1 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/X86.hs @@ -2,12 +2,12 @@ -- | Free regs map for i386 module GHC.CmmToAsm.Reg.Linear.X86 where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.X86.Regs import GHC.Platform.Reg.Class import GHC.Platform.Reg -import Panic +import GHC.Utils.Panic import GHC.Platform import Data.Word diff --git a/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs b/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs index 322ddd6bdd..325e033e85 100644 --- a/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs +++ b/compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs @@ -2,12 +2,12 @@ -- | Free regs map for x86_64 module GHC.CmmToAsm.Reg.Linear.X86_64 where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.X86.Regs import GHC.Platform.Reg.Class import GHC.Platform.Reg -import Panic +import GHC.Utils.Panic import GHC.Platform import Data.Word diff --git a/compiler/GHC/CmmToAsm/Reg/Liveness.hs b/compiler/GHC/CmmToAsm/Reg/Liveness.hs index 5f5d4c8ff3..f650ad6186 100644 --- a/compiler/GHC/CmmToAsm/Reg/Liveness.hs +++ b/compiler/GHC/CmmToAsm/Reg/Liveness.hs @@ -37,7 +37,7 @@ module GHC.CmmToAsm.Reg.Liveness ( regLiveness, cmmTopLiveness ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform.Reg import GHC.CmmToAsm.Instr @@ -49,15 +49,15 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Label import GHC.Cmm hiding (RegSet, emptyRegSet) -import Digraph -import MonadUtils -import Outputable +import GHC.Data.Graph.Directed +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique.Supply -import Bag -import State +import GHC.Data.Bag +import GHC.Utils.Monad.State import Data.List import Data.Maybe diff --git a/compiler/GHC/CmmToAsm/Reg/Target.hs b/compiler/GHC/CmmToAsm/Reg/Target.hs index 183d329790..d4bc561faa 100644 --- a/compiler/GHC/CmmToAsm/Reg/Target.hs +++ b/compiler/GHC/CmmToAsm/Reg/Target.hs @@ -21,13 +21,13 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform.Reg import GHC.Platform.Reg.Class import GHC.CmmToAsm.Format -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Platform diff --git a/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs b/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs index 6cc660bba9..b99b75f5eb 100644 --- a/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/AddrMode.hs @@ -6,7 +6,7 @@ module GHC.CmmToAsm.SPARC.AddrMode ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Imm import GHC.CmmToAsm.SPARC.Base diff --git a/compiler/GHC/CmmToAsm/SPARC/Base.hs b/compiler/GHC/CmmToAsm/SPARC/Base.hs index 85b1de9ef3..a7929081b3 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Base.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Base.hs @@ -17,9 +17,9 @@ module GHC.CmmToAsm.SPARC.Base ( where -import GhcPrelude +import GHC.Prelude -import Panic +import GHC.Utils.Panic import Data.Int diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs index f88b2140a1..2112983e73 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen.hs @@ -20,7 +20,7 @@ where #include "HsVersions.h" -- NCG stuff: -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Base import GHC.CmmToAsm.SPARC.CodeGen.Sanity @@ -53,9 +53,9 @@ import GHC.CmmToAsm.CPrim -- The rest: import GHC.Types.Basic -import FastString -import OrdList -import Outputable +import GHC.Data.FastString +import GHC.Data.OrdList +import GHC.Utils.Outputable import GHC.Platform import Control.Monad ( mapAndUnzipM ) diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs index 75eba25023..87fb09d7d6 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Amode.hs @@ -4,7 +4,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Amode ( where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 import GHC.CmmToAsm.SPARC.CodeGen.Base @@ -18,7 +18,7 @@ import GHC.CmmToAsm.Format import GHC.Cmm -import OrdList +import GHC.Data.OrdList -- | Generate code to reference a memory address. diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs index f00e60ca93..34ee34295d 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Base.hs @@ -13,7 +13,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Base ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Instr import GHC.CmmToAsm.SPARC.Cond @@ -27,8 +27,8 @@ import GHC.Cmm import GHC.Cmm.Ppr.Expr () -- For Outputable instances import GHC.Platform -import Outputable -import OrdList +import GHC.Utils.Outputable +import GHC.Data.OrdList -------------------------------------------------------------------------------- -- | 'InstrBlock's are the insn sequences generated by the insn selectors. diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs index 3f8912a9c4..0a6de1a034 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/CondCode.hs @@ -6,7 +6,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.CondCode ( where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 import GHC.CmmToAsm.SPARC.CodeGen.Base @@ -20,8 +20,8 @@ import GHC.CmmToAsm.Format import GHC.Cmm -import OrdList -import Outputable +import GHC.Data.OrdList +import GHC.Utils.Outputable getCondCode :: CmmExpr -> NatM CondCode diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs index 77732cf70c..495a973c90 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Expand.hs @@ -7,7 +7,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Expand ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Instr import GHC.CmmToAsm.SPARC.Imm @@ -19,8 +19,8 @@ import GHC.CmmToAsm.Format import GHC.Cmm -import Outputable -import OrdList +import GHC.Utils.Outputable +import GHC.Data.OrdList -- | Expand out synthetic instructions in this top level thing expandTop :: NatCmmDecl RawCmmStatics Instr -> NatCmmDecl RawCmmStatics Instr diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs index 494e407d19..e5b5990150 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen32.hs @@ -6,7 +6,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Gen32 ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.CodeGen.CondCode import GHC.CmmToAsm.SPARC.CodeGen.Amode @@ -26,8 +26,8 @@ import GHC.Platform.Reg import GHC.Cmm import Control.Monad (liftM) -import OrdList -import Outputable +import GHC.Data.OrdList +import GHC.Utils.Outputable -- | The dual to getAnyReg: compute an expression into a register, but -- we don't mind which one it is. diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs index 18b22b2a1e..00a94ceb24 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Gen64.hs @@ -7,7 +7,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Gen64 ( where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.CmmToAsm.SPARC.CodeGen.Gen32 import GHC.CmmToAsm.SPARC.CodeGen.Base @@ -24,8 +24,8 @@ import GHC.Platform.Reg import GHC.Cmm -import OrdList -import Outputable +import GHC.Data.OrdList +import GHC.Utils.Outputable -- | Code to assign a 64 bit value to memory. assignMem_I64Code diff --git a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs index f8648c4549..f6ec24434c 100644 --- a/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs +++ b/compiler/GHC/CmmToAsm/SPARC/CodeGen/Sanity.hs @@ -6,7 +6,7 @@ module GHC.CmmToAsm.SPARC.CodeGen.Sanity ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Instr import GHC.CmmToAsm.SPARC.Ppr () -- For Outputable instances @@ -14,7 +14,7 @@ import GHC.CmmToAsm.Instr import GHC.Cmm -import Outputable +import GHC.Utils.Outputable -- | Enforce intra-block invariants. diff --git a/compiler/GHC/CmmToAsm/SPARC/Cond.hs b/compiler/GHC/CmmToAsm/SPARC/Cond.hs index 89b64b7c3a..035de3dd7e 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Cond.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Cond.hs @@ -7,7 +7,7 @@ module GHC.CmmToAsm.SPARC.Cond ( where -import GhcPrelude +import GHC.Prelude -- | Branch condition codes. data Cond diff --git a/compiler/GHC/CmmToAsm/SPARC/Imm.hs b/compiler/GHC/CmmToAsm/SPARC/Imm.hs index 71b0257ac5..fd4185565c 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Imm.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Imm.hs @@ -7,12 +7,12 @@ module GHC.CmmToAsm.SPARC.Imm ( where -import GhcPrelude +import GHC.Prelude import GHC.Cmm import GHC.Cmm.CLabel -import Outputable +import GHC.Utils.Outputable -- | An immediate value. -- Not all of these are directly representable by the machine. diff --git a/compiler/GHC/CmmToAsm/SPARC/Instr.hs b/compiler/GHC/CmmToAsm/SPARC/Instr.hs index a1f890bc6d..6da02818db 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Instr.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Instr.hs @@ -24,7 +24,7 @@ module GHC.CmmToAsm.SPARC.Instr ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Stack import GHC.CmmToAsm.SPARC.Imm @@ -43,8 +43,8 @@ import GHC.Cmm.CLabel import GHC.Platform.Regs import GHC.Cmm.BlockId import GHC.Cmm -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Platform diff --git a/compiler/GHC/CmmToAsm/SPARC/Ppr.hs b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs index 661db9dfbb..3943610346 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Ppr.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Ppr.hs @@ -24,7 +24,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Regs import GHC.CmmToAsm.SPARC.Instr @@ -46,9 +46,9 @@ import GHC.Cmm.Dataflow.Label import GHC.Cmm.Dataflow.Collections import GHC.Types.Unique ( pprUniqueAlways ) -import Outputable +import GHC.Utils.Outputable import GHC.Platform -import FastString +import GHC.Data.FastString -- ----------------------------------------------------------------------------- -- Printing this stuff out diff --git a/compiler/GHC/CmmToAsm/SPARC/Regs.hs b/compiler/GHC/CmmToAsm/SPARC/Regs.hs index d6d5d87bf6..9ee68baee2 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Regs.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Regs.hs @@ -32,7 +32,7 @@ module GHC.CmmToAsm.SPARC.Regs ( where -import GhcPrelude +import GHC.Prelude import GHC.Platform.SPARC import GHC.Platform.Reg @@ -40,7 +40,7 @@ import GHC.Platform.Reg.Class import GHC.CmmToAsm.Format import GHC.Types.Unique -import Outputable +import GHC.Utils.Outputable {- The SPARC has 64 registers of interest; 32 integer registers and 32 diff --git a/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs b/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs index 98f55d13d8..2c5b90d964 100644 --- a/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs +++ b/compiler/GHC/CmmToAsm/SPARC/ShortcutJump.hs @@ -8,7 +8,7 @@ module GHC.CmmToAsm.SPARC.ShortcutJump ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.Instr import GHC.CmmToAsm.SPARC.Imm @@ -17,8 +17,8 @@ import GHC.Cmm.CLabel import GHC.Cmm.BlockId import GHC.Cmm -import Panic -import Outputable +import GHC.Utils.Panic +import GHC.Utils.Outputable data JumpDest = DestBlockId BlockId diff --git a/compiler/GHC/CmmToAsm/SPARC/Stack.hs b/compiler/GHC/CmmToAsm/SPARC/Stack.hs index 861d1ad691..4333f767f7 100644 --- a/compiler/GHC/CmmToAsm/SPARC/Stack.hs +++ b/compiler/GHC/CmmToAsm/SPARC/Stack.hs @@ -7,7 +7,7 @@ module GHC.CmmToAsm.SPARC.Stack ( where -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.SPARC.AddrMode import GHC.CmmToAsm.SPARC.Regs @@ -15,7 +15,7 @@ import GHC.CmmToAsm.SPARC.Base import GHC.CmmToAsm.SPARC.Imm import GHC.CmmToAsm.Config -import Outputable +import GHC.Utils.Outputable -- | Get an AddrMode relative to the address in sp. -- This gives us a stack relative addressing mode for volatile diff --git a/compiler/GHC/CmmToAsm/X86/CodeGen.hs b/compiler/GHC/CmmToAsm/X86/CodeGen.hs index 4bbf791102..2796bc32dc 100644 --- a/compiler/GHC/CmmToAsm/X86/CodeGen.hs +++ b/compiler/GHC/CmmToAsm/X86/CodeGen.hs @@ -36,7 +36,7 @@ where #include "HsVersions.h" -- NCG stuff: -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.X86.Instr import GHC.CmmToAsm.X86.Cond @@ -81,11 +81,11 @@ import GHC.Types.SrcLoc ( srcSpanFile, srcSpanStartLine, srcSpanStartCol ) -- The rest: import GHC.Types.ForeignCall ( CCallConv(..) ) -import OrdList -import Outputable -import FastString +import GHC.Data.OrdList +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Driver.Session -import Util +import GHC.Utils.Misc import GHC.Types.Unique.Supply ( getUniqueM ) import Control.Monad diff --git a/compiler/GHC/CmmToAsm/X86/Cond.hs b/compiler/GHC/CmmToAsm/X86/Cond.hs index bb8f61438b..424a1718b0 100644 --- a/compiler/GHC/CmmToAsm/X86/Cond.hs +++ b/compiler/GHC/CmmToAsm/X86/Cond.hs @@ -9,7 +9,7 @@ module GHC.CmmToAsm.X86.Cond ( where -import GhcPrelude +import GHC.Prelude data Cond = ALWAYS -- What's really used? ToDo diff --git a/compiler/GHC/CmmToAsm/X86/Instr.hs b/compiler/GHC/CmmToAsm/X86/Instr.hs index 9c5888c21d..67a6ffb930 100644 --- a/compiler/GHC/CmmToAsm/X86/Instr.hs +++ b/compiler/GHC/CmmToAsm/X86/Instr.hs @@ -18,7 +18,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.X86.Cond import GHC.CmmToAsm.X86.Regs @@ -34,8 +34,8 @@ import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Dataflow.Label import GHC.Platform.Regs import GHC.Cmm -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Basic (Alignment) diff --git a/compiler/GHC/CmmToAsm/X86/Ppr.hs b/compiler/GHC/CmmToAsm/X86/Ppr.hs index 0b0c406bc4..41c94f90c6 100644 --- a/compiler/GHC/CmmToAsm/X86/Ppr.hs +++ b/compiler/GHC/CmmToAsm/X86/Ppr.hs @@ -22,7 +22,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.X86.Regs import GHC.CmmToAsm.X86.Instr @@ -43,8 +43,8 @@ import GHC.Cmm.BlockId import GHC.Cmm.CLabel import GHC.Types.Unique ( pprUniqueAlways ) import GHC.Platform -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import Data.Word import Data.Bits diff --git a/compiler/GHC/CmmToAsm/X86/RegInfo.hs b/compiler/GHC/CmmToAsm/X86/RegInfo.hs index 5b2464c415..de11279d54 100644 --- a/compiler/GHC/CmmToAsm/X86/RegInfo.hs +++ b/compiler/GHC/CmmToAsm/X86/RegInfo.hs @@ -8,12 +8,12 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm.Format import GHC.Platform.Reg -import Outputable +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique diff --git a/compiler/GHC/CmmToAsm/X86/Regs.hs b/compiler/GHC/CmmToAsm/X86/Regs.hs index ab8e6d3b4f..8e6f215d3c 100644 --- a/compiler/GHC/CmmToAsm/X86/Regs.hs +++ b/compiler/GHC/CmmToAsm/X86/Regs.hs @@ -49,7 +49,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform.Regs import GHC.Platform.Reg @@ -57,7 +57,7 @@ import GHC.Platform.Reg.Class import GHC.Cmm import GHC.Cmm.CLabel ( CLabel ) -import Outputable +import GHC.Utils.Outputable import GHC.Platform import qualified Data.Array as A diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs index 3eddd87785..f4b8878fe2 100644 --- a/compiler/GHC/CmmToC.hs +++ b/compiler/GHC/CmmToC.hs @@ -26,7 +26,7 @@ module GHC.CmmToC ( #include "HsVersions.h" -- Cmm stuff -import GhcPrelude +import GHC.Prelude import GHC.Cmm.BlockId import GHC.Cmm.CLabel @@ -42,13 +42,13 @@ import GHC.Cmm.Switch -- Utils import GHC.CmmToAsm.CPrim import GHC.Driver.Session -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique -import Util +import GHC.Utils.Misc -- The rest import Data.ByteString (ByteString) diff --git a/compiler/GHC/CmmToLlvm.hs b/compiler/GHC/CmmToLlvm.hs index ea69809c13..f91f3578e6 100644 --- a/compiler/GHC/CmmToLlvm.hs +++ b/compiler/GHC/CmmToLlvm.hs @@ -13,7 +13,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.CmmToLlvm.Base @@ -28,14 +28,14 @@ import GHC.Cmm import GHC.Cmm.Dataflow.Collections import GHC.Cmm.Ppr -import BufWrite +import GHC.Utils.BufHandle import GHC.Driver.Session import GHC.Platform ( platformArch, Arch(..) ) -import ErrUtils -import FastString -import Outputable +import GHC.Utils.Error +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.SysTools ( figureLlvmVersion ) -import qualified Stream +import qualified GHC.Data.Stream as Stream import Control.Monad ( when, forM_ ) import Data.Maybe ( fromMaybe, catMaybes ) diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs index b36b4814f1..99f5bd53a4 100644 --- a/compiler/GHC/CmmToLlvm/Base.hs +++ b/compiler/GHC/CmmToLlvm/Base.hs @@ -41,7 +41,7 @@ module GHC.CmmToLlvm.Base ( #include "HsVersions.h" #include "ghcautoconf.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.CmmToLlvm.Regs @@ -49,18 +49,18 @@ import GHC.CmmToLlvm.Regs import GHC.Cmm.CLabel import GHC.Platform.Regs ( activeStgRegs ) import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Cmm hiding ( succ ) import GHC.Cmm.Utils (regsOverlap) -import Outputable as Outp +import GHC.Utils.Outputable as Outp import GHC.Platform import GHC.Types.Unique.FM import GHC.Types.Unique -import BufWrite ( BufHandle ) +import GHC.Utils.BufHandle ( BufHandle ) import GHC.Types.Unique.Set import GHC.Types.Unique.Supply -import ErrUtils -import qualified Stream +import GHC.Utils.Error +import qualified GHC.Data.Stream as Stream import Data.Maybe (fromJust) import Control.Monad (ap) diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs index 7b3d198fa9..e106a5e111 100644 --- a/compiler/GHC/CmmToLlvm/CodeGen.hs +++ b/compiler/GHC/CmmToLlvm/CodeGen.hs @@ -8,7 +8,7 @@ module GHC.CmmToLlvm.CodeGen ( genLlvmProc ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.CmmToLlvm.Base @@ -26,15 +26,15 @@ import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Dataflow.Collections import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import Outputable hiding (panic, pprPanic) -import qualified Outputable +import GHC.Utils.Outputable hiding (panic, pprPanic) +import qualified GHC.Utils.Outputable as Outputable import GHC.Platform -import OrdList +import GHC.Data.OrdList import GHC.Types.Unique.Supply import GHC.Types.Unique -import Util +import GHC.Utils.Misc import Control.Monad.Trans.Class import Control.Monad.Trans.Writer diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs index a862895b3c..b8db6ba4ed 100644 --- a/compiler/GHC/CmmToLlvm/Data.hs +++ b/compiler/GHC/CmmToLlvm/Data.hs @@ -9,7 +9,7 @@ module GHC.CmmToLlvm.Data ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.CmmToLlvm.Base @@ -20,8 +20,8 @@ import GHC.Cmm import GHC.Driver.Session import GHC.Platform -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import qualified Data.ByteString as BS -- ---------------------------------------------------------------------------- diff --git a/compiler/GHC/CmmToLlvm/Mangler.hs b/compiler/GHC/CmmToLlvm/Mangler.hs index 6bf27267d7..0436dbcf07 100644 --- a/compiler/GHC/CmmToLlvm/Mangler.hs +++ b/compiler/GHC/CmmToLlvm/Mangler.hs @@ -11,12 +11,12 @@ module GHC.CmmToLlvm.Mangler ( llvmFixupAsm ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session ( DynFlags, targetPlatform ) import GHC.Platform ( platformArch, Arch(..) ) -import ErrUtils ( withTiming ) -import Outputable ( text ) +import GHC.Utils.Error ( withTiming ) +import GHC.Utils.Outputable ( text ) import Control.Exception import qualified Data.ByteString.Char8 as B diff --git a/compiler/GHC/CmmToLlvm/Ppr.hs b/compiler/GHC/CmmToLlvm/Ppr.hs index 3606ed56c0..290234d48a 100644 --- a/compiler/GHC/CmmToLlvm/Ppr.hs +++ b/compiler/GHC/CmmToLlvm/Ppr.hs @@ -9,7 +9,7 @@ module GHC.CmmToLlvm.Ppr ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.CmmToLlvm.Base @@ -18,8 +18,8 @@ import GHC.CmmToLlvm.Data import GHC.Cmm.CLabel import GHC.Cmm -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.Unique -- ---------------------------------------------------------------------------- diff --git a/compiler/GHC/CmmToLlvm/Regs.hs b/compiler/GHC/CmmToLlvm/Regs.hs index 6e9be62937..0951c7e37f 100644 --- a/compiler/GHC/CmmToLlvm/Regs.hs +++ b/compiler/GHC/CmmToLlvm/Regs.hs @@ -11,14 +11,14 @@ module GHC.CmmToLlvm.Regs ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm import GHC.Cmm.Expr import GHC.Platform -import FastString -import Outputable ( panic ) +import GHC.Data.FastString +import GHC.Utils.Outputable ( panic ) import GHC.Types.Unique -- | Get the LlvmVar function variable storing the real register diff --git a/compiler/GHC/Core.hs b/compiler/GHC/Core.hs index 17384f0d43..6c9bf98ca5 100644 --- a/compiler/GHC/Core.hs +++ b/compiler/GHC/Core.hs @@ -99,7 +99,7 @@ module GHC.Core ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Types.CostCentre @@ -114,11 +114,11 @@ import GHC.Types.Literal import GHC.Core.DataCon import GHC.Types.Module import GHC.Types.Basic -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Unique.Set import GHC.Types.SrcLoc ( RealSrcSpan, containsSpan ) -import Binary +import GHC.Utils.Binary import Data.Data hiding (TyCon) import Data.Int diff --git a/compiler/GHC/Core/Arity.hs b/compiler/GHC/Core/Arity.hs index 9d1adab519..53e47d9746 100644 --- a/compiler/GHC/Core/Arity.hs +++ b/compiler/GHC/Core/Arity.hs @@ -21,7 +21,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.FVs @@ -38,9 +38,9 @@ import GHC.Core.Coercion as Coercion import GHC.Types.Basic import GHC.Types.Unique import GHC.Driver.Session ( DynFlags, GeneralFlag(..), gopt ) -import Outputable -import FastString -import Util ( debugIsOn ) +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Misc ( debugIsOn ) {- ************************************************************************ diff --git a/compiler/GHC/Core/Class.hs b/compiler/GHC/Core/Class.hs index 5fb1fc9ea9..2c2f8c353b 100644 --- a/compiler/GHC/Core/Class.hs +++ b/compiler/GHC/Core/Class.hs @@ -23,7 +23,7 @@ module GHC.Core.Class ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.TyCon ( TyCon ) import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, PredType ) @@ -32,10 +32,10 @@ import GHC.Types.Var import GHC.Types.Name import GHC.Types.Basic import GHC.Types.Unique -import Util +import GHC.Utils.Misc import GHC.Types.SrcLoc -import Outputable -import BooleanFormula (BooleanFormula, mkTrue) +import GHC.Utils.Outputable +import GHC.Data.BooleanFormula (BooleanFormula, mkTrue) import qualified Data.Data as Data diff --git a/compiler/GHC/Core/Coercion.hs b/compiler/GHC/Core/Coercion.hs index ad97c4d7e9..a95c16c372 100644 --- a/compiler/GHC/Core/Coercion.hs +++ b/compiler/GHC/Core/Coercion.hs @@ -121,7 +121,7 @@ module GHC.Core.Coercion ( import {-# SOURCE #-} GHC.CoreToIface (toIfaceTyCon, tidyToIfaceTcArgs) -import GhcPrelude +import GHC.Prelude import GHC.Iface.Type import GHC.Core.TyCo.Rep @@ -136,16 +136,16 @@ import GHC.Types.Var import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Types.Name hiding ( varName ) -import Util +import GHC.Utils.Misc import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique -import Pair +import GHC.Data.Pair import GHC.Types.SrcLoc import GHC.Builtin.Names import GHC.Builtin.Types.Prim -import ListSetOps -import Maybes +import GHC.Data.List.SetOps +import GHC.Data.Maybe import GHC.Types.Unique.FM import Control.Monad (foldM, zipWithM) diff --git a/compiler/GHC/Core/Coercion.hs-boot b/compiler/GHC/Core/Coercion.hs-boot index 8a10e09268..eaf0180bef 100644 --- a/compiler/GHC/Core/Coercion.hs-boot +++ b/compiler/GHC/Core/Coercion.hs-boot @@ -2,7 +2,7 @@ module GHC.Core.Coercion where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.TyCo.Rep import {-# SOURCE #-} GHC.Core.TyCon @@ -10,8 +10,8 @@ import {-# SOURCE #-} GHC.Core.TyCon import GHC.Types.Basic ( LeftOrRight ) import GHC.Core.Coercion.Axiom import GHC.Types.Var -import Pair -import Util +import GHC.Data.Pair +import GHC.Utils.Misc mkReflCo :: Role -> Type -> Coercion mkTyConAppCo :: HasDebugCallStack => Role -> TyCon -> [Coercion] -> Coercion diff --git a/compiler/GHC/Core/Coercion/Axiom.hs b/compiler/GHC/Core/Coercion/Axiom.hs index cc4cbeff6d..4c95da97bc 100644 --- a/compiler/GHC/Core/Coercion/Axiom.hs +++ b/compiler/GHC/Core/Coercion/Axiom.hs @@ -29,19 +29,19 @@ module GHC.Core.Coercion.Axiom ( BuiltInSynFamily(..) ) where -import GhcPrelude +import GHC.Prelude 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 GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Name import GHC.Types.Unique import GHC.Types.Var -import Util -import Binary -import Pair +import GHC.Utils.Misc +import GHC.Utils.Binary +import GHC.Data.Pair import GHC.Types.Basic import Data.Typeable ( Typeable ) import GHC.Types.SrcLoc diff --git a/compiler/GHC/Core/Coercion/Opt.hs b/compiler/GHC/Core/Coercion/Opt.hs index 6a93006791..e8a276e9ed 100644 --- a/compiler/GHC/Core/Coercion/Opt.hs +++ b/compiler/GHC/Core/Coercion/Opt.hs @@ -6,7 +6,7 @@ module GHC.Core.Coercion.Opt ( optCoercion, checkAxInstCo ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core.TyCo.Rep @@ -18,11 +18,11 @@ import GHC.Core.TyCon import GHC.Core.Coercion.Axiom import GHC.Types.Var.Set import GHC.Types.Var.Env -import Outputable +import GHC.Utils.Outputable import GHC.Core.FamInstEnv ( flattenTys ) -import Pair -import ListSetOps ( getNth ) -import Util +import GHC.Data.Pair +import GHC.Data.List.SetOps ( getNth ) +import GHC.Utils.Misc import GHC.Core.Unify import GHC.Core.InstEnv import Control.Monad ( zipWithM ) diff --git a/compiler/GHC/Core/ConLike.hs b/compiler/GHC/Core/ConLike.hs index e6169f7d7c..ed247c9d81 100644 --- a/compiler/GHC/Core/ConLike.hs +++ b/compiler/GHC/Core/ConLike.hs @@ -27,13 +27,13 @@ module GHC.Core.ConLike ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.DataCon import GHC.Core.PatSyn -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique -import Util +import GHC.Utils.Misc import GHC.Types.Name import GHC.Types.Basic import GHC.Core.TyCo.Rep (Type, ThetaType) diff --git a/compiler/GHC/Core/DataCon.hs b/compiler/GHC/Core/DataCon.hs index a4521d688c..0a1955eacf 100644 --- a/compiler/GHC/Core/DataCon.hs +++ b/compiler/GHC/Core/DataCon.hs @@ -61,7 +61,7 @@ module GHC.Core.DataCon ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Types.Id.Make ( DataConBoxer ) import GHC.Core.Type as Type @@ -74,12 +74,12 @@ import GHC.Types.Name import GHC.Builtin.Names import GHC.Core.Predicate import GHC.Types.Var -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Basic -import FastString +import GHC.Data.FastString import GHC.Types.Module -import Binary +import GHC.Utils.Binary import GHC.Types.Unique.Set import GHC.Types.Unique( mkAlphaTyVarUnique ) diff --git a/compiler/GHC/Core/DataCon.hs-boot b/compiler/GHC/Core/DataCon.hs-boot index ab83a75117..aa2b266b06 100644 --- a/compiler/GHC/Core/DataCon.hs-boot +++ b/compiler/GHC/Core/DataCon.hs-boot @@ -1,12 +1,12 @@ module GHC.Core.DataCon where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var( TyVar, TyCoVar, TyVarBinder ) import GHC.Types.Name( Name, NamedThing ) import {-# SOURCE #-} GHC.Core.TyCon( TyCon ) import GHC.Types.FieldLabel ( FieldLabel ) import GHC.Types.Unique ( Uniquable ) -import Outputable ( Outputable, OutputableBndr ) +import GHC.Utils.Outputable ( Outputable, OutputableBndr ) import GHC.Types.Basic (Arity) import {-# SOURCE #-} GHC.Core.TyCo.Rep ( Type, ThetaType ) diff --git a/compiler/GHC/Core/FVs.hs b/compiler/GHC/Core/FVs.hs index 6e7fa259ff..b4430f4139 100644 --- a/compiler/GHC/Core/FVs.hs +++ b/compiler/GHC/Core/FVs.hs @@ -59,7 +59,7 @@ module GHC.Core.FVs ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Types.Id @@ -77,11 +77,11 @@ import GHC.Core.TyCon import GHC.Core.Coercion.Axiom import GHC.Core.FamInstEnv import GHC.Builtin.Types.Prim( funTyConName ) -import Maybes( orElse ) -import Util +import GHC.Data.Maybe( orElse ) +import GHC.Utils.Misc import GHC.Types.Basic( Activation ) -import Outputable -import FV +import GHC.Utils.Outputable +import GHC.Utils.FV as FV {- ************************************************************************ @@ -105,7 +105,7 @@ exprFreeVars :: CoreExpr -> VarSet exprFreeVars = fvVarSet . exprFVs -- | Find all locally-defined free Ids or type variables in an expression --- returning a composable FV computation. See Note [FV naming conventions] in FV +-- returning a composable FV computation. See Note [FV naming conventions] in GHC.Utils.FV -- for why export it. exprFVs :: CoreExpr -> FV exprFVs = filterFV isLocalVar . expr_fvs @@ -150,7 +150,7 @@ exprsFreeVars :: [CoreExpr] -> VarSet exprsFreeVars = fvVarSet . exprsFVs -- | Find all locally-defined free Ids or type variables in several expressions --- returning a composable FV computation. See Note [FV naming conventions] in FV +-- returning a composable FV computation. See Note [FV naming conventions] in GHC.Utils.FV -- for why export it. exprsFVs :: [CoreExpr] -> FV exprsFVs exprs = mapUnionFV exprFVs exprs diff --git a/compiler/GHC/Core/FamInstEnv.hs b/compiler/GHC/Core/FamInstEnv.hs index 6c737b555a..1c01f4fddd 100644 --- a/compiler/GHC/Core/FamInstEnv.hs +++ b/compiler/GHC/Core/FamInstEnv.hs @@ -41,7 +41,7 @@ module GHC.Core.FamInstEnv ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Unify import GHC.Core.Type as Type @@ -53,14 +53,14 @@ import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Types.Name import GHC.Types.Unique.DFM -import Outputable -import Maybes +import GHC.Utils.Outputable +import GHC.Data.Maybe import GHC.Core.Map import GHC.Types.Unique -import Util +import GHC.Utils.Misc import GHC.Types.Var import GHC.Types.SrcLoc -import FastString +import GHC.Data.FastString import Control.Monad import Data.List( mapAccumL ) import Data.Array( Array, assocs ) diff --git a/compiler/GHC/Core/InstEnv.hs b/compiler/GHC/Core/InstEnv.hs index b32d1aa150..b80b237733 100644 --- a/compiler/GHC/Core/InstEnv.hs +++ b/compiler/GHC/Core/InstEnv.hs @@ -31,7 +31,7 @@ module GHC.Core.InstEnv ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.TcType -- InstEnv is really part of the type checker, -- and depends on TcType in many ways @@ -43,11 +43,11 @@ import GHC.Types.Var.Set import GHC.Types.Name import GHC.Types.Name.Set import GHC.Core.Unify -import Outputable -import ErrUtils +import GHC.Utils.Outputable +import GHC.Utils.Error import GHC.Types.Basic import GHC.Types.Unique.DFM -import Util +import GHC.Utils.Misc import GHC.Types.Id import Data.Data ( Data ) import Data.Maybe ( isJust, isNothing ) diff --git a/compiler/GHC/Core/Lint.hs b/compiler/GHC/Core/Lint.hs index b496b87484..bc74b7d393 100644 --- a/compiler/GHC/Core/Lint.hs +++ b/compiler/GHC/Core/Lint.hs @@ -23,14 +23,14 @@ module GHC.Core.Lint ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.FVs import GHC.Core.Utils import GHC.Core.Stats ( coreBindsStats ) import GHC.Core.Opt.Monad -import Bag +import GHC.Data.Bag import GHC.Types.Literal import GHC.Core.DataCon import GHC.Builtin.Types.Prim @@ -43,7 +43,7 @@ import GHC.Types.Name import GHC.Types.Id import GHC.Types.Id.Info import GHC.Core.Ppr -import ErrUtils +import GHC.Utils.Error import GHC.Core.Coercion import GHC.Types.SrcLoc import GHC.Core.Type as Type @@ -55,12 +55,12 @@ import GHC.Core.TyCo.Ppr ( pprTyVar ) import GHC.Core.TyCon as TyCon import GHC.Core.Coercion.Axiom import GHC.Types.Basic -import ErrUtils as Err -import ListSetOps +import GHC.Utils.Error as Err +import GHC.Data.List.SetOps import GHC.Builtin.Names -import Outputable -import FastString -import Util +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Core.InstEnv ( instanceDFunId ) import GHC.Core.Coercion.Opt ( checkAxInstCo ) import GHC.Core.Arity ( typeArity ) @@ -69,12 +69,12 @@ import GHC.Types.Demand ( splitStrictSig, isBotDiv ) import GHC.Driver.Types import GHC.Driver.Session import Control.Monad -import MonadUtils +import GHC.Utils.Monad import Data.Foldable ( toList ) import Data.List.NonEmpty ( NonEmpty ) import Data.List ( partition ) import Data.Maybe -import Pair +import GHC.Data.Pair import qualified GHC.LanguageExtensions as LangExt {- @@ -2211,7 +2211,7 @@ top-level ones. See Note [Exported LocalIds] and #9857. Note [Checking StaticPtrs] ~~~~~~~~~~~~~~~~~~~~~~~~~~ -See Note [Grand plan for static forms] in StaticPtrTable for an overview. +See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable for an overview. Every occurrence of the function 'makeStatic' should be moved to the top level by the FloatOut pass. It's vital that we don't have nested diff --git a/compiler/GHC/Core/Make.hs b/compiler/GHC/Core/Make.hs index bf927ebd4d..38710f3829 100644 --- a/compiler/GHC/Core/Make.hs +++ b/compiler/GHC/Core/Make.hs @@ -54,7 +54,7 @@ module GHC.Core.Make ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Id import GHC.Types.Var ( EvVar, setTyVarUnique ) @@ -77,11 +77,11 @@ import GHC.Types.Id.Info import GHC.Types.Demand import GHC.Types.Cpr import GHC.Types.Name hiding ( varName ) -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Unique.Supply import GHC.Types.Basic -import Util +import GHC.Utils.Misc import Data.List import Data.Char ( ord ) diff --git a/compiler/GHC/Core/Map.hs b/compiler/GHC/Core/Map.hs index bb4eeb0fff..6fc041887d 100644 --- a/compiler/GHC/Core/Map.hs +++ b/compiler/GHC/Core/Map.hs @@ -37,23 +37,23 @@ module GHC.Core.Map ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import TrieMap +import GHC.Data.TrieMap import GHC.Core import GHC.Core.Coercion import GHC.Types.Name import GHC.Core.Type import GHC.Core.TyCo.Rep import GHC.Types.Var -import FastString(FastString) -import Util +import GHC.Data.FastString(FastString) +import GHC.Utils.Misc import qualified Data.Map as Map import qualified Data.IntMap as IntMap import GHC.Types.Var.Env import GHC.Types.Name.Env -import Outputable +import GHC.Utils.Outputable import Control.Monad( (>=>) ) {- diff --git a/compiler/GHC/Core/Opt/CSE.hs b/compiler/GHC/Core/Opt/CSE.hs index 07e243d662..39e5dd8d0a 100644 --- a/compiler/GHC/Core/Opt/CSE.hs +++ b/compiler/GHC/Core/Opt/CSE.hs @@ -13,7 +13,7 @@ module GHC.Core.Opt.CSE (cseProgram, cseOneExpr) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Subst import GHC.Types.Var ( Var ) @@ -28,10 +28,10 @@ import GHC.Core.Utils ( mkAltExpr, eqExpr import GHC.Core.FVs ( exprFreeVars ) import GHC.Core.Type ( tyConAppArgs ) import GHC.Core -import Outputable +import GHC.Utils.Outputable import GHC.Types.Basic import GHC.Core.Map -import Util ( filterOut, equalLength, debugIsOn ) +import GHC.Utils.Misc ( filterOut, equalLength, debugIsOn ) import Data.List ( mapAccumL ) {- diff --git a/compiler/GHC/Core/Opt/CallArity.hs b/compiler/GHC/Core/Opt/CallArity.hs index 33a0e7c31d..ef5bb94b23 100644 --- a/compiler/GHC/Core/Opt/CallArity.hs +++ b/compiler/GHC/Core/Opt/CallArity.hs @@ -7,7 +7,7 @@ module GHC.Core.Opt.CallArity , callArityRHS -- for testing ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var.Set import GHC.Types.Var.Env @@ -18,9 +18,9 @@ import GHC.Core import GHC.Types.Id import GHC.Core.Arity ( typeArity ) import GHC.Core.Utils ( exprIsCheap, exprIsTrivial ) -import UnVarGraph +import GHC.Data.Graph.UnVar import GHC.Types.Demand -import Util +import GHC.Utils.Misc import Control.Arrow ( first, second ) diff --git a/compiler/GHC/Core/Opt/ConstantFold.hs b/compiler/GHC/Core/Opt/ConstantFold.hs index 91b44af996..7c18f27003 100644 --- a/compiler/GHC/Core/Opt/ConstantFold.hs +++ b/compiler/GHC/Core/Opt/ConstantFold.hs @@ -26,7 +26,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Types.Id.Make ( mkPrimOpId, magicDictId ) @@ -49,13 +49,13 @@ import GHC.Core.Unfold ( exprIsConApp_maybe ) import GHC.Core.Type import GHC.Types.Name.Occurrence ( occNameFS ) import GHC.Builtin.Names -import Maybes ( orElse ) +import GHC.Data.Maybe ( orElse ) import GHC.Types.Name ( Name, nameOccName ) -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Basic import GHC.Platform -import Util +import GHC.Utils.Misc import GHC.Core.Coercion (mkUnbranchedAxInstCo,mkSymCo,Role(..)) import Control.Applicative ( Alternative(..) ) diff --git a/compiler/GHC/Core/Opt/CprAnal.hs b/compiler/GHC/Core/Opt/CprAnal.hs index 4bc96a81d9..f29c8e7133 100644 --- a/compiler/GHC/Core/Opt/CprAnal.hs +++ b/compiler/GHC/Core/Opt/CprAnal.hs @@ -11,14 +11,14 @@ module GHC.Core.Opt.CprAnal ( cprAnalProgram ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Types.Demand import GHC.Types.Cpr import GHC.Core import GHC.Core.Seq -import Outputable +import GHC.Utils.Outputable import GHC.Types.Var.Env import GHC.Types.Basic import Data.List @@ -30,9 +30,9 @@ import GHC.Core.TyCon import GHC.Core.Type import GHC.Core.FamInstEnv import GHC.Core.Opt.WorkWrap.Utils -import Util -import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) ) -import Maybes ( isJust, isNothing ) +import GHC.Utils.Misc +import GHC.Utils.Error ( dumpIfSet_dyn, DumpFormat (..) ) +import GHC.Data.Maybe ( isJust, isNothing ) {- Note [Constructed Product Result] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/compiler/GHC/Core/Opt/DmdAnal.hs b/compiler/GHC/Core/Opt/DmdAnal.hs index 30956fd768..5d4e650564 100644 --- a/compiler/GHC/Core/Opt/DmdAnal.hs +++ b/compiler/GHC/Core/Opt/DmdAnal.hs @@ -13,14 +13,14 @@ module GHC.Core.Opt.DmdAnal ( dmdAnalProgram ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core.Opt.WorkWrap.Utils ( findTypeShape ) import GHC.Types.Demand -- All of it import GHC.Core import GHC.Core.Seq ( seqBinds ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Var.Env import GHC.Types.Basic import Data.List ( mapAccumL ) @@ -32,11 +32,11 @@ import GHC.Core.TyCon import GHC.Core.Type import GHC.Core.Coercion ( Coercion, coVarsOfCo ) import GHC.Core.FamInstEnv -import Util -import Maybes ( isJust ) +import GHC.Utils.Misc +import GHC.Data.Maybe ( isJust ) import GHC.Builtin.Types import GHC.Builtin.Types.Prim ( realWorldStatePrimTy ) -import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) ) +import GHC.Utils.Error ( dumpIfSet_dyn, DumpFormat (..) ) import GHC.Types.Unique.Set {- diff --git a/compiler/GHC/Core/Opt/Driver.hs b/compiler/GHC/Core/Opt/Driver.hs index 0da360e589..43470240a6 100644 --- a/compiler/GHC/Core/Opt/Driver.hs +++ b/compiler/GHC/Core/Opt/Driver.hs @@ -10,7 +10,7 @@ module GHC.Core.Opt.Driver ( core2core, simplifyExpr ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core @@ -31,12 +31,12 @@ import GHC.Core.Opt.Simplify.Utils ( simplEnvForGHCi, activeRule, activeUnfoldin import GHC.Core.Opt.Simplify.Env import GHC.Core.Opt.Simplify.Monad import GHC.Core.Opt.Monad -import qualified ErrUtils as Err +import qualified GHC.Utils.Error as Err import GHC.Core.Opt.FloatIn ( floatInwards ) import GHC.Core.Opt.FloatOut ( floatOutwards ) import GHC.Core.FamInstEnv import GHC.Types.Id -import ErrUtils ( withTiming, withTimingD, DumpFormat (..) ) +import GHC.Utils.Error ( withTiming, withTimingD, DumpFormat (..) ) import GHC.Types.Basic ( CompilerPhase(..), isDefaultInlinePragma, defaultInlinePragma ) import GHC.Types.Var.Set import GHC.Types.Var.Env @@ -50,14 +50,14 @@ import GHC.Core.Opt.CallArity ( callArityAnalProgram ) import GHC.Core.Opt.Exitify ( exitifyProgram ) import GHC.Core.Opt.WorkWrap ( wwTopBinds ) import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc import GHC.Types.Module import GHC.Driver.Plugins ( withPlugins, installCoreToDos ) import GHC.Runtime.Loader -- ( initializePlugins ) import GHC.Types.Unique.Supply ( UniqSupply, mkSplitUniqSupply, splitUniqSupply ) import GHC.Types.Unique.FM -import Outputable +import GHC.Utils.Outputable import Control.Monad import qualified GHC.LanguageExtensions as LangExt {- @@ -186,7 +186,7 @@ getCoreToDo dflags )) -- Static forms are moved to the top level with the FloatOut pass. - -- See Note [Grand plan for static forms] in StaticPtrTable. + -- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. static_ptrs_float_outwards = runWhen static_ptrs $ CoreDoPasses [ simpl_gently -- Float Out can't handle type lets (sometimes created @@ -248,7 +248,7 @@ getCoreToDo dflags else -- Even with full laziness turned off, we still need to float static -- forms to the top level. See Note [Grand plan for static forms] in - -- StaticPtrTable. + -- GHC.Iface.Tidy.StaticPtrTable. static_ptrs_float_outwards, simpl_phases, diff --git a/compiler/GHC/Core/Opt/Exitify.hs b/compiler/GHC/Core/Opt/Exitify.hs index 088d0cb085..d903185c1d 100644 --- a/compiler/GHC/Core/Opt/Exitify.hs +++ b/compiler/GHC/Core/Opt/Exitify.hs @@ -35,20 +35,20 @@ Example result: Now `t` is no longer in a recursive function, and good things happen! -} -import GhcPrelude +import GHC.Prelude import GHC.Types.Var import GHC.Types.Id import GHC.Types.Id.Info import GHC.Core import GHC.Core.Utils -import State +import GHC.Utils.Monad.State import GHC.Types.Unique import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Core.FVs -import FastString +import GHC.Data.FastString import GHC.Core.Type -import Util( mapSnd ) +import GHC.Utils.Misc( mapSnd ) import Data.Bifunctor import Control.Monad diff --git a/compiler/GHC/Core/Opt/FloatIn.hs b/compiler/GHC/Core/Opt/FloatIn.hs index c5b8acc7f6..4d759a47bc 100644 --- a/compiler/GHC/Core/Opt/FloatIn.hs +++ b/compiler/GHC/Core/Opt/FloatIn.hs @@ -20,7 +20,7 @@ module GHC.Core.Opt.FloatIn ( floatInwards ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Core @@ -33,9 +33,9 @@ import GHC.Types.Id ( isOneShotBndr, idType, isJoinId, isJoinId_maybe ) import GHC.Types.Var import GHC.Core.Type import GHC.Types.Var.Set -import Util +import GHC.Utils.Misc import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable -- import Data.List ( mapAccumL ) import GHC.Types.Basic ( RecFlag(..), isRec ) diff --git a/compiler/GHC/Core/Opt/FloatOut.hs b/compiler/GHC/Core/Opt/FloatOut.hs index d9d2d4dccf..92a747424f 100644 --- a/compiler/GHC/Core/Opt/FloatOut.hs +++ b/compiler/GHC/Core/Opt/FloatOut.hs @@ -10,7 +10,7 @@ module GHC.Core.Opt.FloatOut ( floatOutwards ) where -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Utils @@ -19,15 +19,15 @@ import GHC.Core.Arity ( etaExpand ) import GHC.Core.Opt.Monad ( FloatOutSwitches(..) ) import GHC.Driver.Session -import ErrUtils ( dumpIfSet_dyn, DumpFormat (..) ) +import GHC.Utils.Error ( dumpIfSet_dyn, DumpFormat (..) ) import GHC.Types.Id ( Id, idArity, idType, isBottomingId, isJoinId, isJoinId_maybe ) import GHC.Core.Opt.SetLevels import GHC.Types.Unique.Supply ( UniqSupply ) -import Bag -import Util -import Maybes -import Outputable +import GHC.Data.Bag +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Utils.Outputable import GHC.Core.Type import qualified Data.IntMap as M diff --git a/compiler/GHC/Core/Opt/LiberateCase.hs b/compiler/GHC/Core/Opt/LiberateCase.hs index 2e284e3611..7a28abce20 100644 --- a/compiler/GHC/Core/Opt/LiberateCase.hs +++ b/compiler/GHC/Core/Opt/LiberateCase.hs @@ -9,7 +9,7 @@ module GHC.Core.Opt.LiberateCase ( liberateCase ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core @@ -17,7 +17,7 @@ import GHC.Core.Unfold ( couldBeSmallEnoughToInline ) import GHC.Builtin.Types ( unitDataConId ) import GHC.Types.Id import GHC.Types.Var.Env -import Util ( notNull ) +import GHC.Utils.Misc ( notNull ) {- The liberate-case transformation diff --git a/compiler/GHC/Core/Opt/Monad.hs b/compiler/GHC/Core/Opt/Monad.hs index 81faa53e47..19d0eec4a9 100644 --- a/compiler/GHC/Core/Opt/Monad.hs +++ b/compiler/GHC/Core/Opt/Monad.hs @@ -48,7 +48,7 @@ module GHC.Core.Opt.Monad ( dumpIfSet_dyn ) where -import GhcPrelude hiding ( read ) +import GHC.Prelude hiding ( read ) import GHC.Core import GHC.Driver.Types @@ -57,18 +57,18 @@ import GHC.Driver.Session import GHC.Types.Basic ( CompilerPhase(..) ) import GHC.Types.Annotations -import IOEnv hiding ( liftIO, failM, failWithM ) -import qualified IOEnv ( liftIO ) +import GHC.Data.IOEnv hiding ( liftIO, failM, failWithM ) +import qualified GHC.Data.IOEnv as IOEnv import GHC.Types.Var -import Outputable -import FastString -import ErrUtils( Severity(..), DumpFormat (..), dumpOptionsFromFlag ) +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString +import GHC.Utils.Error( Severity(..), DumpFormat (..), dumpOptionsFromFlag ) import GHC.Types.Unique.Supply -import MonadUtils +import GHC.Utils.Monad import GHC.Types.Name.Env import GHC.Types.SrcLoc import Data.Bifunctor ( bimap ) -import ErrUtils (dumpAction) +import GHC.Utils.Error (dumpAction) import Data.List (intersperse, groupBy, sortBy) import Data.Ord import Data.Dynamic @@ -78,7 +78,7 @@ import qualified Data.Map.Strict as MapStrict import Data.Word import Control.Monad import Control.Applicative ( Alternative(..) ) -import Panic (throwGhcException, GhcException(..)) +import GHC.Utils.Panic (throwGhcException, GhcException(..)) {- ************************************************************************ diff --git a/compiler/GHC/Core/Opt/Monad.hs-boot b/compiler/GHC/Core/Opt/Monad.hs-boot index 6ea3a5b790..b92602dc59 100644 --- a/compiler/GHC/Core/Opt/Monad.hs-boot +++ b/compiler/GHC/Core/Opt/Monad.hs-boot @@ -9,9 +9,9 @@ module GHC.Core.Opt.Monad ( CoreToDo, CoreM ) where -import GhcPrelude +import GHC.Prelude -import IOEnv ( IOEnv ) +import GHC.Data.IOEnv ( IOEnv ) type CoreIOEnv = IOEnv CoreReader diff --git a/compiler/GHC/Core/Opt/OccurAnal.hs b/compiler/GHC/Core/Opt/OccurAnal.hs index 4fe039cc52..21c7f86d78 100644 --- a/compiler/GHC/Core/Opt/OccurAnal.hs +++ b/compiler/GHC/Core/Opt/OccurAnal.hs @@ -18,7 +18,7 @@ module GHC.Core.Opt.OccurAnal ( occurAnalysePgm, occurAnalyseExpr ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.FVs @@ -36,15 +36,15 @@ import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Types.Var import GHC.Types.Demand ( argOneShots, argsOneShots ) -import Digraph ( SCC(..), Node(..) - , stronglyConnCompFromEdgedVerticesUniq - , stronglyConnCompFromEdgedVerticesUniqR ) +import GHC.Data.Graph.Directed ( SCC(..), Node(..) + , stronglyConnCompFromEdgedVerticesUniq + , stronglyConnCompFromEdgedVerticesUniqR ) import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import Util -import Maybes( orElse, isJust ) -import Outputable +import GHC.Utils.Misc +import GHC.Data.Maybe( orElse, isJust ) +import GHC.Utils.Outputable import Data.List {- @@ -1240,7 +1240,7 @@ makeNode env imp_rule_edges bndr_set (bndr, rhs) = DigraphNode details (varUnique bndr) (nonDetKeysUniqSet node_fvs) -- It's OK to use nonDetKeysUniqSet here as stronglyConnCompFromEdgedVerticesR -- is still deterministic with edges in nondeterministic order as - -- explained in Note [Deterministic SCC] in Digraph. + -- explained in Note [Deterministic SCC] in GHC.Data.Graph.Directed. where details = ND { nd_bndr = bndr' , nd_rhs = rhs' @@ -1334,7 +1334,7 @@ mkLoopBreakerNodes env lvl bndr_set body_uds details_s -- It's OK to use nonDetKeysUniqSet here as -- stronglyConnCompFromEdgedVerticesR is still deterministic with edges -- in nondeterministic order as explained in - -- Note [Deterministic SCC] in Digraph. + -- Note [Deterministic SCC] in GHC.Data.Graph.Directed. where nd' = nd { nd_bndr = new_bndr, nd_score = score } score = nodeScore env new_bndr lb_deps nd diff --git a/compiler/GHC/Core/Opt/SetLevels.hs b/compiler/GHC/Core/Opt/SetLevels.hs index 710a8cf70f..8f5d9c654a 100644 --- a/compiler/GHC/Core/Opt/SetLevels.hs +++ b/compiler/GHC/Core/Opt/SetLevels.hs @@ -64,7 +64,7 @@ module GHC.Core.Opt.SetLevels ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Opt.Monad ( FloatOutSwitches(..) ) @@ -97,13 +97,13 @@ import GHC.Types.Basic ( Arity, RecFlag(..), isRec ) import GHC.Core.DataCon ( dataConOrigResTy ) import GHC.Builtin.Types import GHC.Types.Unique.Supply -import Util -import Outputable -import FastString +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Unique.DFM -import FV +import GHC.Utils.FV import Data.Maybe -import MonadUtils ( mapAccumLM ) +import GHC.Utils.Monad ( mapAccumLM ) {- ************************************************************************ @@ -702,7 +702,7 @@ lvlMFE env strict_ctxt ann_expr join_arity_maybe = Nothing is_mk_static = isJust (collectMakeStaticArgs expr) - -- Yuk: See Note [Grand plan for static forms] in main/StaticPtrTable + -- Yuk: See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable -- A decision to float entails let-binding this thing, and we only do -- that if we'll escape a value lambda, or will go to the top level. @@ -1699,7 +1699,7 @@ newLvlVar lvld_rhs join_arity_maybe is_mk_static rhs_ty = exprType de_tagged_rhs mk_id uniq rhs_ty - -- See Note [Grand plan for static forms] in StaticPtrTable. + -- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. | is_mk_static = mkExportedVanillaId (mkSystemVarName uniq (mkFastString "static_ptr")) rhs_ty diff --git a/compiler/GHC/Core/Opt/Simplify.hs b/compiler/GHC/Core/Opt/Simplify.hs index d2b63ecb94..8198ba32cf 100644 --- a/compiler/GHC/Core/Opt/Simplify.hs +++ b/compiler/GHC/Core/Opt/Simplify.hs @@ -11,7 +11,7 @@ module GHC.Core.Opt.Simplify ( simplTopBinds, simplExpr, simplRules ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Driver.Session @@ -49,14 +49,14 @@ import GHC.Core.FVs ( mkRuleInfo ) import GHC.Core.Rules ( lookupRule, getRules ) import GHC.Types.Basic ( TopLevelFlag(..), isNotTopLevel, isTopLevel, RecFlag(..), Arity ) -import MonadUtils ( mapAccumLM, liftIO ) +import GHC.Utils.Monad ( mapAccumLM, liftIO ) import GHC.Types.Var ( isTyCoVar ) -import Maybes ( orElse ) +import GHC.Data.Maybe ( orElse ) import Control.Monad -import Outputable -import FastString -import Util -import ErrUtils +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Misc +import GHC.Utils.Error import GHC.Types.Module ( moduleName, pprModuleName ) import GHC.Builtin.PrimOps ( PrimOp (SeqOp) ) diff --git a/compiler/GHC/Core/Opt/Simplify/Env.hs b/compiler/GHC/Core/Opt/Simplify/Env.hs index 2827ba037d..4a749e8951 100644 --- a/compiler/GHC/Core/Opt/Simplify/Env.hs +++ b/compiler/GHC/Core/Opt/Simplify/Env.hs @@ -45,7 +45,7 @@ module GHC.Core.Opt.Simplify.Env ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Opt.Simplify.Monad import GHC.Core.Opt.Monad ( SimplMode(..) ) @@ -54,7 +54,7 @@ import GHC.Core.Utils import GHC.Types.Var import GHC.Types.Var.Env import GHC.Types.Var.Set -import OrdList +import GHC.Data.OrdList import GHC.Types.Id as Id import GHC.Core.Make ( mkWildValBinder ) import GHC.Driver.Session ( DynFlags ) @@ -64,9 +64,9 @@ import GHC.Core.Type hiding ( substTy, substTyVar, substTyVarBndr, extendTvS import qualified GHC.Core.Coercion as Coercion import GHC.Core.Coercion hiding ( substCo, substCoVar, substCoVarBndr ) import GHC.Types.Basic -import MonadUtils -import Outputable -import Util +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Unique.FM ( pprUniqFM ) import Data.List (mapAccumL) diff --git a/compiler/GHC/Core/Opt/Simplify/Monad.hs b/compiler/GHC/Core/Opt/Simplify/Monad.hs index 043ced977b..b36d440402 100644 --- a/compiler/GHC/Core/Opt/Simplify/Monad.hs +++ b/compiler/GHC/Core/Opt/Simplify/Monad.hs @@ -20,7 +20,7 @@ module GHC.Core.Opt.Simplify.Monad ( plusSimplCount, isZeroSimplCount ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var ( Var, isId, mkLocalVar ) import GHC.Types.Name ( mkSystemVarName ) @@ -32,12 +32,12 @@ import GHC.Core ( RuleEnv(..) ) import GHC.Types.Unique.Supply import GHC.Driver.Session import GHC.Core.Opt.Monad -import Outputable -import FastString -import MonadUtils -import ErrUtils as Err -import Util ( count ) -import Panic (throwGhcExceptionIO, GhcException (..)) +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Monad +import GHC.Utils.Error as Err +import GHC.Utils.Misc ( count ) +import GHC.Utils.Panic (throwGhcExceptionIO, GhcException (..)) import GHC.Types.Basic ( IntWithInf, treatZeroAsInf, mkIntWithInf ) import Control.Monad ( ap ) diff --git a/compiler/GHC/Core/Opt/Simplify/Utils.hs b/compiler/GHC/Core/Opt/Simplify/Utils.hs index 1de946f724..14e1a08fe0 100644 --- a/compiler/GHC/Core/Opt/Simplify/Utils.hs +++ b/compiler/GHC/Core/Opt/Simplify/Utils.hs @@ -38,7 +38,7 @@ module GHC.Core.Opt.Simplify.Utils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Opt.Simplify.Env import GHC.Core.Opt.Monad ( SimplMode(..), Tick(..) ) @@ -63,12 +63,12 @@ import GHC.Core.Opt.Simplify.Monad import GHC.Core.Type hiding( substTy ) import GHC.Core.Coercion hiding( substCo ) import GHC.Core.DataCon ( dataConWorkId, isNullaryRepDataCon ) -import Util -import OrdList ( isNilOL ) -import MonadUtils -import Outputable +import GHC.Utils.Misc +import GHC.Data.OrdList ( isNilOL ) +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Core.Opt.ConstantFold -import FastString ( fsLit ) +import GHC.Data.FastString ( fsLit ) import Control.Monad ( when ) import Data.List ( sortBy ) diff --git a/compiler/GHC/Core/Opt/SpecConstr.hs b/compiler/GHC/Core/Opt/SpecConstr.hs index f0a7821b1f..60029cb478 100644 --- a/compiler/GHC/Core/Opt/SpecConstr.hs +++ b/compiler/GHC/Core/Opt/SpecConstr.hs @@ -21,7 +21,7 @@ module GHC.Core.Opt.SpecConstr( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Subst @@ -46,17 +46,17 @@ import GHC.Types.Name import GHC.Types.Basic import GHC.Driver.Session ( DynFlags(..), GeneralFlag( Opt_SpecConstrKeen ) , gopt, hasPprDebug ) -import Maybes ( orElse, catMaybes, isJust, isNothing ) +import GHC.Data.Maybe ( orElse, catMaybes, isJust, isNothing ) import GHC.Types.Demand import GHC.Types.Cpr import GHC.Serialized ( deserializeWithData ) -import Util -import Pair +import GHC.Utils.Misc +import GHC.Data.Pair import GHC.Types.Unique.Supply -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Unique.FM -import MonadUtils +import GHC.Utils.Monad import Control.Monad ( zipWithM ) import Data.List import GHC.Builtin.Names ( specTyConName ) diff --git a/compiler/GHC/Core/Opt/Specialise.hs b/compiler/GHC/Core/Opt/Specialise.hs index b1a85fa93f..f40e67adcd 100644 --- a/compiler/GHC/Core/Opt/Specialise.hs +++ b/compiler/GHC/Core/Opt/Specialise.hs @@ -13,7 +13,7 @@ module GHC.Core.Opt.Specialise ( specProgram, specUnfolding ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Id import GHC.Tc.Utils.TcType hiding( substTy ) @@ -38,16 +38,16 @@ import GHC.Types.Unique.Supply import GHC.Types.Name import GHC.Types.Id.Make ( voidArgId, voidPrimId ) import GHC.Builtin.Types.Prim ( voidPrimTy ) -import Maybes ( mapMaybe, maybeToList, isJust ) -import MonadUtils ( foldlM ) +import GHC.Data.Maybe ( mapMaybe, maybeToList, isJust ) +import GHC.Utils.Monad ( foldlM ) import GHC.Types.Basic import GHC.Driver.Types -import Bag +import GHC.Data.Bag import GHC.Driver.Session -import Util -import Outputable -import FastString -import State +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Monad.State import GHC.Types.Unique.DFM import GHC.Core.TyCo.Rep (TyCoBinder (..)) diff --git a/compiler/GHC/Core/Opt/StaticArgs.hs b/compiler/GHC/Core/Opt/StaticArgs.hs index 0abcc06382..827a3e90a5 100644 --- a/compiler/GHC/Core/Opt/StaticArgs.hs +++ b/compiler/GHC/Core/Opt/StaticArgs.hs @@ -51,7 +51,7 @@ essential to make this work well! {-# LANGUAGE CPP #-} module GHC.Core.Opt.StaticArgs ( doStaticArgs ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var import GHC.Core @@ -62,15 +62,15 @@ import GHC.Types.Id import GHC.Types.Name import GHC.Types.Var.Env import GHC.Types.Unique.Supply -import Util +import GHC.Utils.Misc import GHC.Types.Unique.FM import GHC.Types.Var.Set import GHC.Types.Unique import GHC.Types.Unique.Set -import Outputable +import GHC.Utils.Outputable import Data.List (mapAccumL) -import FastString +import GHC.Data.FastString #include "HsVersions.h" diff --git a/compiler/GHC/Core/Opt/WorkWrap.hs b/compiler/GHC/Core/Opt/WorkWrap.hs index 0ba6acb731..52cdf04edf 100644 --- a/compiler/GHC/Core/Opt/WorkWrap.hs +++ b/compiler/GHC/Core/Opt/WorkWrap.hs @@ -7,7 +7,7 @@ {-# LANGUAGE CPP #-} module GHC.Core.Opt.WorkWrap ( wwTopBinds ) where -import GhcPrelude +import GHC.Prelude import GHC.Core.Arity ( manifestArity ) import GHC.Core @@ -24,10 +24,10 @@ import GHC.Driver.Session import GHC.Types.Demand import GHC.Types.Cpr import GHC.Core.Opt.WorkWrap.Utils -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Core.FamInstEnv -import MonadUtils +import GHC.Utils.Monad #include "HsVersions.h" diff --git a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs index cbd8788d66..4c4c3dc5e7 100644 --- a/compiler/GHC/Core/Opt/WorkWrap/Utils.hs +++ b/compiler/GHC/Core/Opt/WorkWrap/Utils.hs @@ -16,7 +16,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Utils ( exprType, mkCast, mkDefaultCase, mkSingleAltCase ) @@ -42,12 +42,12 @@ import GHC.Types.Basic ( Boxity(..) ) import GHC.Core.TyCon import GHC.Types.Unique.Supply import GHC.Types.Unique -import Maybes -import Util -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Driver.Session -import FastString -import ListSetOps +import GHC.Data.FastString +import GHC.Data.List.SetOps {- ************************************************************************ @@ -345,7 +345,7 @@ f x y = join j (z, w) = \(u, v) -> ... in jump j (x, y) Typically this happens with functions that are seen as computing functions, -rather than being curried. (The real-life example was GraphOps.addConflicts.) +rather than being curried. (The real-life example was GHC.Data.Graph.Ops.addConflicts.) When we create the wrapper, it *must* be in "eta-contracted" form so that the jump has the right number of arguments: diff --git a/compiler/GHC/Core/PatSyn.hs b/compiler/GHC/Core/PatSyn.hs index 39e91795d6..6179cd600b 100644 --- a/compiler/GHC/Core/PatSyn.hs +++ b/compiler/GHC/Core/PatSyn.hs @@ -24,14 +24,14 @@ module GHC.Core.PatSyn ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Type import GHC.Core.TyCo.Ppr import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique -import Util +import GHC.Utils.Misc import GHC.Types.Basic import GHC.Types.Var import GHC.Types.FieldLabel diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs index df88351df2..6c3eedb77f 100644 --- a/compiler/GHC/Core/Ppr.hs +++ b/compiler/GHC/Core/Ppr.hs @@ -17,7 +17,7 @@ module GHC.Core.Ppr ( pprRules, pprOptCo ) where -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Stats (exprStats) @@ -33,10 +33,10 @@ import GHC.Core.TyCon import GHC.Core.TyCo.Ppr import GHC.Core.Coercion import GHC.Types.Basic -import Maybes -import Util -import Outputable -import FastString +import GHC.Data.Maybe +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.SrcLoc ( pprUserRealSpan ) {- diff --git a/compiler/GHC/Core/Ppr/TyThing.hs b/compiler/GHC/Core/Ppr/TyThing.hs index 6782ba1518..628d13ad7f 100644 --- a/compiler/GHC/Core/Ppr/TyThing.hs +++ b/compiler/GHC/Core/Ppr/TyThing.hs @@ -19,7 +19,7 @@ module GHC.Core.Ppr.TyThing ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Type ( Type, ArgFlag(..), TyThing(..), mkTyVarBinders, tidyOpenType ) import GHC.Iface.Syntax ( ShowSub(..), ShowHowMuch(..), AltPpr(..) @@ -31,7 +31,7 @@ import GHC.Core.FamInstEnv( FamInst(..), FamFlavor(..) ) import GHC.Core.TyCo.Ppr ( pprUserForAll, pprTypeApp, pprSigmaType ) import GHC.Types.Name import GHC.Types.Var.Env( emptyTidyEnv ) -import Outputable +import GHC.Utils.Outputable -- ----------------------------------------------------------------------------- -- Pretty-printing entities that we get from the GHC API diff --git a/compiler/GHC/Core/Predicate.hs b/compiler/GHC/Core/Predicate.hs index dbeb099440..9f0eefef30 100644 --- a/compiler/GHC/Core/Predicate.hs +++ b/compiler/GHC/Core/Predicate.hs @@ -28,7 +28,7 @@ module GHC.Core.Predicate ( DictId, isEvVar, isDictId ) where -import GhcPrelude +import GHC.Prelude import GHC.Core.Type import GHC.Core.Class @@ -38,9 +38,9 @@ import GHC.Core.Coercion import GHC.Builtin.Names -import FastString -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc import Control.Monad ( guard ) diff --git a/compiler/GHC/Core/Rules.hs b/compiler/GHC/Core/Rules.hs index 899ae25d1b..d4e60446bf 100644 --- a/compiler/GHC/Core/Rules.hs +++ b/compiler/GHC/Core/Rules.hs @@ -28,7 +28,7 @@ module GHC.Core.Rules ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core -- All of it import GHC.Types.Module ( Module, ModuleSet, elemModuleSet ) @@ -60,11 +60,11 @@ import GHC.Core.Unify as Unify ( ruleMatchTyKiX ) import GHC.Types.Basic import GHC.Driver.Session ( DynFlags, gopt, targetPlatform ) import GHC.Driver.Flags -import Outputable -import FastString -import Maybes -import Bag -import Util +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Maybe +import GHC.Data.Bag +import GHC.Utils.Misc import Data.List import Data.Ord import Control.Monad ( guard ) diff --git a/compiler/GHC/Core/Seq.hs b/compiler/GHC/Core/Seq.hs index 451a6fa4e3..25a6ab31dc 100644 --- a/compiler/GHC/Core/Seq.hs +++ b/compiler/GHC/Core/Seq.hs @@ -10,7 +10,7 @@ module GHC.Core.Seq ( megaSeqIdInfo, seqRuleInfo, seqBinds, ) where -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Types.Id.Info diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs index 7545209b77..2f9d86627f 100644 --- a/compiler/GHC/Core/SimpleOpt.hs +++ b/compiler/GHC/Core/SimpleOpt.hs @@ -20,7 +20,7 @@ module GHC.Core.SimpleOpt ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.Arity( etaExpandToJoinPoint ) @@ -49,13 +49,13 @@ import GHC.Builtin.Types import GHC.Builtin.Names import GHC.Types.Basic import GHC.Types.Module ( Module ) -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Session -import Outputable -import Pair -import Util -import Maybes ( orElse ) -import FastString +import GHC.Utils.Outputable +import GHC.Data.Pair +import GHC.Utils.Misc +import GHC.Data.Maybe ( orElse ) +import GHC.Data.FastString import Data.List import qualified Data.ByteString as BS diff --git a/compiler/GHC/Core/Stats.hs b/compiler/GHC/Core/Stats.hs index 29f2f44df4..cdff8283be 100644 --- a/compiler/GHC/Core/Stats.hs +++ b/compiler/GHC/Core/Stats.hs @@ -11,11 +11,11 @@ module GHC.Core.Stats ( CoreStats(..), coreBindsStats, exprStats, ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic import GHC.Core -import Outputable +import GHC.Utils.Outputable import GHC.Core.Coercion import GHC.Types.Var import GHC.Core.Type(Type, typeSize) diff --git a/compiler/GHC/Core/Subst.hs b/compiler/GHC/Core/Subst.hs index 9963875bf3..ddb5b61f7b 100644 --- a/compiler/GHC/Core/Subst.hs +++ b/compiler/GHC/Core/Subst.hs @@ -37,7 +37,7 @@ module GHC.Core.Subst ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.FVs @@ -60,9 +60,9 @@ import GHC.Types.Name ( Name ) import GHC.Types.Var import GHC.Types.Id.Info import GHC.Types.Unique.Supply -import Maybes -import Util -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Misc +import GHC.Utils.Outputable import Data.List diff --git a/compiler/GHC/Core/Tidy.hs b/compiler/GHC/Core/Tidy.hs index 0b9d91af8a..c31b58f6ed 100644 --- a/compiler/GHC/Core/Tidy.hs +++ b/compiler/GHC/Core/Tidy.hs @@ -15,7 +15,7 @@ module GHC.Core.Tidy ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Seq ( seqUnfolding ) @@ -29,7 +29,7 @@ import GHC.Types.Var.Env import GHC.Types.Unique.FM import GHC.Types.Name hiding (tidyNameOcc) import GHC.Types.SrcLoc -import Maybes +import GHC.Data.Maybe import Data.List {- diff --git a/compiler/GHC/Core/TyCo/FVs.hs b/compiler/GHC/Core/TyCo/FVs.hs index 3c4246750f..f54cbe71b3 100644 --- a/compiler/GHC/Core/TyCo/FVs.hs +++ b/compiler/GHC/Core/TyCo/FVs.hs @@ -43,7 +43,7 @@ module GHC.Core.TyCo.FVs #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.Type (coreView, partitionInvisibleTypes) @@ -51,13 +51,13 @@ import Data.Monoid as DM ( Endo(..), All(..) ) import GHC.Core.TyCo.Rep import GHC.Core.TyCon import GHC.Types.Var -import FV +import GHC.Utils.FV import GHC.Types.Unique.FM import GHC.Types.Var.Set import GHC.Types.Var.Env -import Util -import Panic +import GHC.Utils.Misc +import GHC.Utils.Panic {- %************************************************************************ @@ -523,14 +523,14 @@ closeOverKindsDSet = fvDVarSet . closeOverKindsFV . dVarSetElems -- | `tyCoFVsOfType` that returns free variables of a type in a deterministic -- set. For explanation of why using `VarSet` is not deterministic see --- Note [Deterministic FV] in FV. +-- Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfTypeDSet :: Type -> DTyCoVarSet -- See Note [Free variables of types] tyCoVarsOfTypeDSet ty = fvDVarSet $ tyCoFVsOfType ty -- | `tyCoFVsOfType` that returns free variables of a type in deterministic -- order. For explanation of why using `VarSet` is not deterministic see --- Note [Deterministic FV] in FV. +-- Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfTypeList :: Type -> [TyCoVar] -- See Note [Free variables of types] tyCoVarsOfTypeList ty = fvVarList $ tyCoFVsOfType ty @@ -554,10 +554,10 @@ tyCoVarsOfTypesList tys = fvVarList $ tyCoFVsOfTypes tys -- make the function quadratic. -- It's exported, so that it can be composed with -- other functions that compute free variables. --- See Note [FV naming conventions] in FV. +-- See Note [FV naming conventions] in GHC.Utils.FV. -- -- Eta-expanded because that makes it run faster (apparently) --- See Note [FV eta expansion] in FV for explanation. +-- See Note [FV eta expansion] in GHC.Utils.FV for explanation. tyCoFVsOfType :: Type -> FV -- See Note [Free variables of types] tyCoFVsOfType (TyVarTy v) f bound_vars (acc_list, acc_set) diff --git a/compiler/GHC/Core/TyCo/Ppr.hs b/compiler/GHC/Core/TyCo/Ppr.hs index 751aa11b75..973641bf5c 100644 --- a/compiler/GHC/Core/TyCo/Ppr.hs +++ b/compiler/GHC/Core/TyCo/Ppr.hs @@ -25,7 +25,7 @@ module GHC.Core.TyCo.Ppr pprTyThingCategory, pprShortTyThing, ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.CoreToIface ( toIfaceTypeX, toIfaceTyLit, toIfaceForAllBndr @@ -50,7 +50,7 @@ import GHC.Iface.Type import GHC.Types.Var.Set import GHC.Types.Var.Env -import Outputable +import GHC.Utils.Outputable import GHC.Types.Basic ( PprPrec(..), topPrec, sigPrec, opPrec , funPrec, appPrec, maybeParen ) diff --git a/compiler/GHC/Core/TyCo/Ppr.hs-boot b/compiler/GHC/Core/TyCo/Ppr.hs-boot index 64562d9a28..8e89c334ea 100644 --- a/compiler/GHC/Core/TyCo/Ppr.hs-boot +++ b/compiler/GHC/Core/TyCo/Ppr.hs-boot @@ -1,7 +1,7 @@ module GHC.Core.TyCo.Ppr where import {-# SOURCE #-} GHC.Core.TyCo.Rep (Type, Kind, Coercion, TyLit) -import Outputable +import GHC.Utils.Outputable pprType :: Type -> SDoc pprKind :: Kind -> SDoc diff --git a/compiler/GHC/Core/TyCo/Rep.hs b/compiler/GHC/Core/TyCo/Rep.hs index 00d3f95c43..4ac731bc07 100644 --- a/compiler/GHC/Core/TyCo/Rep.hs +++ b/compiler/GHC/Core/TyCo/Rep.hs @@ -70,7 +70,7 @@ module GHC.Core.TyCo.Rep ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.TyCo.Ppr ( pprType, pprCo, pprTyLit ) @@ -88,9 +88,9 @@ import GHC.Core.Coercion.Axiom -- others import GHC.Types.Basic ( LeftOrRight(..), pickLR ) -import Outputable -import FastString -import Util +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Misc -- libraries import qualified Data.Data as Data hiding ( TyCon ) diff --git a/compiler/GHC/Core/TyCo/Subst.hs b/compiler/GHC/Core/TyCo/Subst.hs index a4d0c49b46..ed885bfdfd 100644 --- a/compiler/GHC/Core/TyCo/Subst.hs +++ b/compiler/GHC/Core/TyCo/Subst.hs @@ -53,7 +53,7 @@ module GHC.Core.TyCo.Subst #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.Type ( mkCastTy, mkAppTy, isCoercionTy ) @@ -74,13 +74,13 @@ import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Var.Env -import Pair -import Util +import GHC.Data.Pair +import GHC.Utils.Misc import GHC.Types.Unique.Supply import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import Outputable +import GHC.Utils.Outputable import Data.List (mapAccumL) diff --git a/compiler/GHC/Core/TyCo/Tidy.hs b/compiler/GHC/Core/TyCo/Tidy.hs index f18ee4f132..8ec4b5818b 100644 --- a/compiler/GHC/Core/TyCo/Tidy.hs +++ b/compiler/GHC/Core/TyCo/Tidy.hs @@ -18,7 +18,7 @@ module GHC.Core.TyCo.Tidy tidyTyCoVarBinder, tidyTyCoVarBinders ) where -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCo.Rep import GHC.Core.TyCo.FVs (tyCoVarsOfTypesWellScoped, tyCoVarsOfTypeList) @@ -26,7 +26,7 @@ import GHC.Core.TyCo.FVs (tyCoVarsOfTypesWellScoped, tyCoVarsOfTypeList) import GHC.Types.Name hiding (varName) import GHC.Types.Var import GHC.Types.Var.Env -import Util (seqList) +import GHC.Utils.Misc (seqList) import Data.List (mapAccumL) diff --git a/compiler/GHC/Core/TyCon.hs b/compiler/GHC/Core/TyCon.hs index e82cb2e219..c45b744c7b 100644 --- a/compiler/GHC/Core/TyCon.hs +++ b/compiler/GHC/Core/TyCon.hs @@ -134,7 +134,7 @@ module GHC.Core.TyCon( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import {-# SOURCE #-} GHC.Core.TyCo.Rep @@ -149,7 +149,7 @@ import {-# SOURCE #-} GHC.Core.DataCon , dataConTyCon, dataConFullSig , isUnboxedSumCon ) -import Binary +import GHC.Utils.Binary import GHC.Types.Var import GHC.Types.Var.Set import GHC.Core.Class @@ -159,12 +159,12 @@ import GHC.Types.Name import GHC.Types.Name.Env import GHC.Core.Coercion.Axiom import GHC.Builtin.Names -import Maybes -import Outputable -import FastStringEnv +import GHC.Data.Maybe +import GHC.Utils.Outputable +import GHC.Data.FastString.Env import GHC.Types.FieldLabel import GHC.Settings.Constants -import Util +import GHC.Utils.Misc import GHC.Types.Unique( tyConRepNameUnique, dataConTyRepNameUnique ) import GHC.Types.Unique.Set import GHC.Types.Module diff --git a/compiler/GHC/Core/TyCon.hs-boot b/compiler/GHC/Core/TyCon.hs-boot index 84df99b0a9..1081249d19 100644 --- a/compiler/GHC/Core/TyCon.hs-boot +++ b/compiler/GHC/Core/TyCon.hs-boot @@ -1,6 +1,6 @@ module GHC.Core.TyCon where -import GhcPrelude +import GHC.Prelude data TyCon diff --git a/compiler/GHC/Core/Type.hs b/compiler/GHC/Core/Type.hs index a6521801b4..1e7af2d8cf 100644 --- a/compiler/GHC/Core/Type.hs +++ b/compiler/GHC/Core/Type.hs @@ -221,7 +221,7 @@ module GHC.Core.Type ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic @@ -260,15 +260,15 @@ import {-# SOURCE #-} GHC.Core.Coercion , isReflexiveCo, seqCo ) -- others -import Util -import FV -import Outputable -import FastString -import Pair -import ListSetOps +import GHC.Utils.Misc +import GHC.Utils.FV +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Pair +import GHC.Data.List.SetOps import GHC.Types.Unique ( nonDetCmpUnique ) -import Maybes ( orElse ) +import GHC.Data.Maybe ( orElse ) import Data.Maybe ( isJust ) import Control.Monad ( guard ) diff --git a/compiler/GHC/Core/Type.hs-boot b/compiler/GHC/Core/Type.hs-boot index e2d479be7d..08efbf608d 100644 --- a/compiler/GHC/Core/Type.hs-boot +++ b/compiler/GHC/Core/Type.hs-boot @@ -2,10 +2,10 @@ module GHC.Core.Type where -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCon import {-# SOURCE #-} GHC.Core.TyCo.Rep( Type, Coercion ) -import Util +import GHC.Utils.Misc isPredTy :: HasDebugCallStack => Type -> Bool isCoercionTy :: Type -> Bool diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs index 6c88c5a24d..f619e36f8a 100644 --- a/compiler/GHC/Core/Unfold.hs +++ b/compiler/GHC/Core/Unfold.hs @@ -44,7 +44,7 @@ module GHC.Core.Unfold ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core @@ -62,12 +62,12 @@ import GHC.Types.Basic ( Arity, InlineSpec(..), inlinePragmaSpec ) import GHC.Core.Type import GHC.Builtin.Names import GHC.Builtin.Types.Prim ( realWorldStatePrimTy ) -import Bag -import Util -import Outputable +import GHC.Data.Bag +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Types.ForeignCall import GHC.Types.Name -import ErrUtils +import GHC.Utils.Error import qualified Data.ByteString as BS import Data.List diff --git a/compiler/GHC/Core/Unfold.hs-boot b/compiler/GHC/Core/Unfold.hs-boot index 54895ae8b1..4706af49e7 100644 --- a/compiler/GHC/Core/Unfold.hs-boot +++ b/compiler/GHC/Core/Unfold.hs-boot @@ -2,7 +2,7 @@ module GHC.Core.Unfold ( mkUnfolding, mkInlineUnfolding ) where -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Driver.Session diff --git a/compiler/GHC/Core/Unify.hs b/compiler/GHC/Core/Unify.hs index 2e77a9909e..3801126ba9 100644 --- a/compiler/GHC/Core/Unify.hs +++ b/compiler/GHC/Core/Unify.hs @@ -26,7 +26,7 @@ module GHC.Core.Unify ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Var import GHC.Types.Var.Env @@ -38,10 +38,10 @@ 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 -import Outputable +import GHC.Utils.FV( FV, fvVarSet, fvVarList ) +import GHC.Utils.Misc +import GHC.Data.Pair +import GHC.Utils.Outputable import GHC.Types.Unique.FM import GHC.Types.Unique.Set diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs index d954374eef..6faf179489 100644 --- a/compiler/GHC/Core/Utils.hs +++ b/compiler/GHC/Core/Utils.hs @@ -62,7 +62,7 @@ module GHC.Core.Utils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Core @@ -86,19 +86,19 @@ import GHC.Core.TyCo.Rep( TyCoBinder(..), TyBinder ) import GHC.Core.Coercion import GHC.Core.TyCon import GHC.Types.Unique -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Types.Prim -import FastString -import Maybes -import ListSetOps ( minusList ) +import GHC.Data.FastString +import GHC.Data.Maybe +import GHC.Data.List.SetOps( minusList ) import GHC.Types.Basic ( Arity ) -import Util -import Pair +import GHC.Utils.Misc +import GHC.Data.Pair import Data.ByteString ( ByteString ) import Data.Function ( on ) import Data.List import Data.Ord ( comparing ) -import OrdList +import GHC.Data.OrdList import qualified Data.Set as Set import GHC.Types.Unique.Set @@ -2099,7 +2099,7 @@ eqExpr in_scope e1 e2 env' = rnBndrs2 env bs1 bs2 go env (Case e1 b1 t1 a1) (Case e2 b2 t2 a2) - | null a1 -- See Note [Empty case alternatives] in TrieMap + | null a1 -- See Note [Empty case alternatives] in GHC.Data.TrieMap = null a2 && go env e1 e2 && eqTypeX env t1 t2 | otherwise = go env e1 e2 && all2 (go_alt (rnBndr2 env b1 b2)) a1 a2 @@ -2147,7 +2147,7 @@ diffExpr top env (Let bs1 e1) (Let bs2 e2) in ds ++ diffExpr top env' e1 e2 diffExpr top env (Case e1 b1 t1 a1) (Case e2 b2 t2 a2) | equalLength a1 a2 && not (null a1) || eqTypeX env t1 t2 - -- See Note [Empty case alternatives] in TrieMap + -- See Note [Empty case alternatives] in GHC.Data.TrieMap = diffExpr top env e1 e2 ++ concat (zipWith diffAlt a1 a2) where env' = rnBndr2 env b1 b2 diffAlt (c1, bs1, e1) (c2, bs2, e2) diff --git a/compiler/GHC/CoreToByteCode.hs b/compiler/GHC/CoreToByteCode.hs index b2f185498c..1f3c0dd85d 100644 --- a/compiler/GHC/CoreToByteCode.hs +++ b/compiler/GHC/CoreToByteCode.hs @@ -12,7 +12,7 @@ module GHC.CoreToByteCode ( UnlinkedBCO, byteCodeGen, coreExprToBCOs ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.ByteCode.Instr import GHC.ByteCode.Asm @@ -23,7 +23,7 @@ import GHCi.FFI import GHCi.RemoteTypes import GHC.Types.Basic import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable import GHC.Platform import GHC.Types.Name import GHC.Types.Id.Make @@ -41,20 +41,20 @@ import GHC.Core.Type import GHC.Types.RepType import GHC.Core.DataCon import GHC.Core.TyCon -import Util +import GHC.Utils.Misc import GHC.Types.Var.Set import GHC.Builtin.Types.Prim import GHC.Core.TyCo.Ppr ( pprType ) -import ErrUtils +import GHC.Utils.Error import GHC.Types.Unique -import FastString -import Panic +import GHC.Data.FastString +import GHC.Utils.Panic import GHC.StgToCmm.Closure ( NonVoid(..), fromNonVoid, nonVoidIds ) import GHC.StgToCmm.Layout import GHC.Runtime.Heap.Layout hiding (WordOff, ByteOff, wordsToBytes) import GHC.Data.Bitmap -import OrdList -import Maybes +import GHC.Data.OrdList +import GHC.Data.Maybe import GHC.Types.Var.Env import GHC.Builtin.Names ( unsafeEqualityProofName ) @@ -73,7 +73,7 @@ import Data.Map (Map) import Data.IntMap (IntMap) import qualified Data.Map as Map import qualified Data.IntMap as IntMap -import qualified FiniteMap as Map +import qualified GHC.Data.FiniteMap as Map import Data.Ord import GHC.Stack.CCS import Data.Either ( partitionEithers ) diff --git a/compiler/GHC/CoreToIface.hs b/compiler/GHC/CoreToIface.hs index dcce320ed9..93c5ba5672 100644 --- a/compiler/GHC/CoreToIface.hs +++ b/compiler/GHC/CoreToIface.hs @@ -45,7 +45,7 @@ module GHC.CoreToIface #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Syntax import GHC.Core.DataCon @@ -62,9 +62,9 @@ import GHC.Types.Name import GHC.Types.Basic import GHC.Core.Type import GHC.Core.PatSyn -import Outputable -import FastString -import Util +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Types.Var import GHC.Types.Var.Env import GHC.Types.Var.Set diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs index a35c81789b..8534ff7738 100644 --- a/compiler/GHC/CoreToStg.hs +++ b/compiler/GHC/CoreToStg.hs @@ -15,7 +15,7 @@ module GHC.CoreToStg ( coreToStg ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Core.Utils ( exprType, findDefault, isJoinBind @@ -37,10 +37,10 @@ import GHC.Types.Name ( isExternalName, nameModule_maybe ) import GHC.Types.Basic ( Arity ) import GHC.Builtin.Types ( unboxedUnitDataCon, unitDataConId ) import GHC.Types.Literal -import Outputable -import MonadUtils -import FastString -import Util +import GHC.Utils.Outputable +import GHC.Utils.Monad +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Driver.Session import GHC.Driver.Ways import GHC.Types.ForeignCall diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index 50ae474cdf..c4c2463153 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -17,7 +17,7 @@ module GHC.CoreToStg.Prep ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Core.Opt.OccurAnal @@ -48,18 +48,18 @@ import GHC.Core.DataCon import GHC.Types.Basic import GHC.Types.Module import GHC.Types.Unique.Supply -import Maybes -import OrdList -import ErrUtils +import GHC.Data.Maybe +import GHC.Data.OrdList +import GHC.Utils.Error import GHC.Driver.Session import GHC.Driver.Ways -import Util -import Outputable -import FastString +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Name ( NamedThing(..), nameSrcSpan, isInternalName ) import GHC.Types.SrcLoc ( SrcSpan(..), realSrcLocSpan, mkRealSrcLoc ) import Data.Bits -import MonadUtils ( mapAccumLM ) +import GHC.Utils.Monad ( mapAccumLM ) import Control.Monad import GHC.Types.CostCentre ( CostCentre, ccFromThisModule ) import qualified Data.Set as S diff --git a/compiler/utils/Bag.hs b/compiler/GHC/Data/Bag.hs index e1eea48000..aa18bec5e1 100644 --- a/compiler/utils/Bag.hs +++ b/compiler/GHC/Data/Bag.hs @@ -8,7 +8,7 @@ Bag: an unordered collection with duplicates {-# LANGUAGE ScopedTypeVariables, CPP, DeriveFunctor #-} -module Bag ( +module GHC.Data.Bag ( Bag, -- abstract type emptyBag, unitBag, unionBags, unionManyBags, @@ -25,12 +25,12 @@ module Bag ( anyBagM, filterBagM ) where -import GhcPrelude +import GHC.Prelude -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc -import MonadUtils +import GHC.Utils.Monad import Control.Monad import Data.Data import Data.Maybe( mapMaybe ) diff --git a/compiler/GHC/Data/Bitmap.hs b/compiler/GHC/Data/Bitmap.hs index 55700ddf9a..0b7158aa24 100644 --- a/compiler/GHC/Data/Bitmap.hs +++ b/compiler/GHC/Data/Bitmap.hs @@ -14,7 +14,7 @@ module GHC.Data.Bitmap ( mAX_SMALL_BITMAP_SIZE, ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Runtime.Heap.Layout diff --git a/compiler/utils/BooleanFormula.hs b/compiler/GHC/Data/BooleanFormula.hs index 76d80eb305..15c97558eb 100644 --- a/compiler/utils/BooleanFormula.hs +++ b/compiler/GHC/Data/BooleanFormula.hs @@ -7,7 +7,7 @@ -- -- This module is used to represent minimal complete definitions for classes. -- -module BooleanFormula ( +module GHC.Data.BooleanFormula ( BooleanFormula(..), LBooleanFormula, mkFalse, mkTrue, mkAnd, mkOr, mkVar, isFalse, isTrue, @@ -16,14 +16,14 @@ module BooleanFormula ( pprBooleanFormula, pprBooleanFormulaNice ) where -import GhcPrelude +import GHC.Prelude import Data.List ( nub, intersperse ) import Data.Data -import MonadUtils -import Outputable -import Binary +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Utils.Binary import GHC.Types.SrcLoc import GHC.Types.Unique import GHC.Types.Unique.Set diff --git a/compiler/utils/EnumSet.hs b/compiler/GHC/Data/EnumSet.hs index 670a5c64c8..61d6bf002b 100644 --- a/compiler/utils/EnumSet.hs +++ b/compiler/GHC/Data/EnumSet.hs @@ -1,6 +1,6 @@ -- | A tiny wrapper around 'IntSet.IntSet' for representing sets of 'Enum' -- things. -module EnumSet +module GHC.Data.EnumSet ( EnumSet , member , insert @@ -10,7 +10,7 @@ module EnumSet , empty ) where -import GhcPrelude +import GHC.Prelude import qualified Data.IntSet as IntSet diff --git a/compiler/utils/FastMutInt.hs b/compiler/GHC/Data/FastMutInt.hs index 20206f8b1e..cc81b88b01 100644 --- a/compiler/utils/FastMutInt.hs +++ b/compiler/GHC/Data/FastMutInt.hs @@ -7,7 +7,7 @@ -- -- Unboxed mutable Ints -module FastMutInt( +module GHC.Data.FastMutInt( FastMutInt, newFastMutInt, readFastMutInt, writeFastMutInt, @@ -15,7 +15,7 @@ module FastMutInt( readFastMutPtr, writeFastMutPtr ) where -import GhcPrelude +import GHC.Prelude import Data.Bits import GHC.Base diff --git a/compiler/utils/FastString.hs b/compiler/GHC/Data/FastString.hs index 9a74eff16d..82f38601f5 100644 --- a/compiler/utils/FastString.hs +++ b/compiler/GHC/Data/FastString.hs @@ -29,7 +29,7 @@ -- arbitrary Unicode strings. -- -- Use 'PtrString' unless you want the facilities of 'FastString'. -module FastString +module GHC.Data.FastString ( -- * ByteString bytesFS, -- :: FastString -> ByteString @@ -97,12 +97,12 @@ module FastString #include "HsVersions.h" -import GhcPrelude as Prelude +import GHC.Prelude as Prelude -import Encoding -import FastFunctions -import PlainPanic -import Util +import GHC.Utils.Encoding +import GHC.Utils.IO.Unsafe +import GHC.Utils.Panic.Plain +import GHC.Utils.Misc import Control.Concurrent.MVar import Control.DeepSeq diff --git a/compiler/utils/FastStringEnv.hs b/compiler/GHC/Data/FastString/Env.hs index bc151f736b..36fab5727c 100644 --- a/compiler/utils/FastStringEnv.hs +++ b/compiler/GHC/Data/FastString/Env.hs @@ -3,10 +3,10 @@ % (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -\section[FastStringEnv]{@FastStringEnv@: FastString environments} -} -module FastStringEnv ( +-- | FastStringEnv: FastString environments +module GHC.Data.FastString.Env ( -- * FastString environments (maps) FastStringEnv, @@ -27,12 +27,12 @@ module FastStringEnv ( mkDFsEnv, emptyDFsEnv, dFsEnvElts, lookupDFsEnv ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import Maybes -import FastString +import GHC.Data.Maybe +import GHC.Data.FastString -- | A non-deterministic set of FastStrings. diff --git a/compiler/utils/FiniteMap.hs b/compiler/GHC/Data/FiniteMap.hs index 0692830932..055944d320 100644 --- a/compiler/utils/FiniteMap.hs +++ b/compiler/GHC/Data/FiniteMap.hs @@ -1,13 +1,13 @@ -- Some extra functions to extend Data.Map -module FiniteMap ( +module GHC.Data.FiniteMap ( insertList, insertListWith, deleteList, foldRight, foldRightWithKey ) where -import GhcPrelude +import GHC.Prelude import Data.Map (Map) import qualified Data.Map as Map diff --git a/compiler/utils/GraphBase.hs b/compiler/GHC/Data/Graph/Base.hs index 67c362ff00..3c40645660 100644 --- a/compiler/utils/GraphBase.hs +++ b/compiler/GHC/Data/Graph/Base.hs @@ -1,6 +1,6 @@ -- | Types for the general graph colorer. -module GraphBase ( +module GHC.Data.Graph.Base ( Triv, Graph (..), initGraph, @@ -12,7 +12,7 @@ module GraphBase ( where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique.Set import GHC.Types.Unique.FM diff --git a/compiler/utils/GraphColor.hs b/compiler/GHC/Data/Graph/Color.hs index d10b28175c..948447da58 100644 --- a/compiler/utils/GraphColor.hs +++ b/compiler/GHC/Data/Graph/Color.hs @@ -5,25 +5,25 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -module GraphColor ( - module GraphBase, - module GraphOps, - module GraphPpr, +module GHC.Data.Graph.Color ( + module GHC.Data.Graph.Base, + module GHC.Data.Graph.Ops, + module GHC.Data.Graph.Ppr, colorGraph ) where -import GhcPrelude +import GHC.Prelude -import GraphBase -import GraphOps -import GraphPpr +import GHC.Data.Graph.Base +import GHC.Data.Graph.Ops +import GHC.Data.Graph.Ppr import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import Outputable +import GHC.Utils.Outputable import Data.Maybe import Data.List diff --git a/compiler/utils/Digraph.hs b/compiler/GHC/Data/Graph/Directed.hs index ad5fbf53c3..c3f397051a 100644 --- a/compiler/utils/Digraph.hs +++ b/compiler/GHC/Data/Graph/Directed.hs @@ -3,7 +3,7 @@ {-# LANGUAGE CPP, ScopedTypeVariables, ViewPatterns #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} -module Digraph( +module GHC.Data.Graph.Directed ( Graph, graphFromEdgedVerticesOrd, graphFromEdgedVerticesUniq, SCC(..), Node(..), flattenSCC, flattenSCCs, @@ -42,11 +42,11 @@ module Digraph( ------------------------------------------------------------------------------ -import GhcPrelude +import GHC.Prelude -import Util ( minWith, count ) -import Outputable -import Maybes ( expectJust ) +import GHC.Utils.Misc ( minWith, count ) +import GHC.Utils.Outputable +import GHC.Data.Maybe ( expectJust ) -- std interfaces import Data.Maybe diff --git a/compiler/utils/GraphOps.hs b/compiler/GHC/Data/Graph/Ops.hs index a1693c6a5a..7d9ce669c6 100644 --- a/compiler/utils/GraphOps.hs +++ b/compiler/GHC/Data/Graph/Ops.hs @@ -3,28 +3,44 @@ {-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-} -module GraphOps ( - addNode, delNode, getNode, lookupNode, modNode, - size, - union, - addConflict, delConflict, addConflicts, - addCoalesce, delCoalesce, - addExclusion, addExclusions, - addPreference, - coalesceNodes, coalesceGraph, - freezeNode, freezeOneInGraph, freezeAllInGraph, - scanGraph, - setColor, - validateGraph, - slurpNodeConflictCount -) +module GHC.Data.Graph.Ops + ( addNode + , delNode + , getNode + , lookupNode + , modNode + + , size + , union + + , addConflict + , delConflict + , addConflicts + + , addCoalesce + , delCoalesce + + , addExclusion + , addExclusions + + , addPreference + , coalesceNodes + , coalesceGraph + , freezeNode + , freezeOneInGraph + , freezeAllInGraph + , scanGraph + , setColor + , validateGraph + , slurpNodeConflictCount + ) where -import GhcPrelude +import GHC.Prelude -import GraphBase +import GHC.Data.Graph.Base -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM @@ -389,10 +405,10 @@ coalesceNodes_merge aggressive triv graph kMin kMax nMin nMax -- sanity checks | nodeClass nMin /= nodeClass nMax - = error "GraphOps.coalesceNodes: can't coalesce nodes of different classes." + = error "GHC.Data.Graph.Ops.coalesceNodes: can't coalesce nodes of different classes." | not (isNothing (nodeColor nMin) && isNothing (nodeColor nMax)) - = error "GraphOps.coalesceNodes: can't coalesce colored nodes." + = error "GHC.Data.Graph.Ops.coalesceNodes: can't coalesce colored nodes." --- | otherwise @@ -473,7 +489,7 @@ freezeNode k freezeEdge k node = if elementOfUniqSet k (nodeCoalesce node) then node { nodeCoalesce = delOneFromUniqSet (nodeCoalesce node) k } - else node -- panic "GraphOps.freezeNode: edge to freeze wasn't in the coalesce set" + else node -- panic "GHC.Data.Graph.Ops.freezeNode: edge to freeze wasn't in the coalesce set" -- If the edge isn't actually in the coelesce set then just ignore it. fm2 = nonDetFoldUniqSet (adjustUFM_C (freezeEdge k)) fm1 @@ -570,7 +586,7 @@ validateGraph doc isColored graph , nodes <- mkUniqSet $ map nodeId $ nonDetEltsUFM $ graphMap graph , badEdges <- minusUniqSet edges nodes , not $ isEmptyUniqSet badEdges - = pprPanic "GraphOps.validateGraph" + = pprPanic "GHC.Data.Graph.Ops.validateGraph" ( text "Graph has edges that point to non-existent nodes" $$ text " bad edges: " <> pprUFM (getUniqSet badEdges) (vcat . map ppr) $$ doc ) @@ -580,7 +596,7 @@ validateGraph doc isColored graph $ nonDetEltsUFM $ graphMap graph -- See Note [Unique Determinism and code generation] , not $ null badNodes - = pprPanic "GraphOps.validateGraph" + = pprPanic "GHC.Data.Graph.Ops.validateGraph" ( text "Node has same color as one of it's conflicts" $$ text " bad nodes: " <> hcat (map (ppr . nodeId) badNodes) $$ doc) @@ -591,7 +607,7 @@ validateGraph doc isColored graph , badNodes <- filter (\n -> isNothing $ nodeColor n) $ nonDetEltsUFM $ graphMap graph , not $ null badNodes - = pprPanic "GraphOps.validateGraph" + = pprPanic "GHC.Data.Graph.Ops.validateGraph" ( text "Supposably colored graph has uncolored nodes." $$ text " uncolored nodes: " <> hcat (map (ppr . nodeId) badNodes) $$ doc ) diff --git a/compiler/utils/GraphPpr.hs b/compiler/GHC/Data/Graph/Ppr.hs index 4327ec881c..020284ea7e 100644 --- a/compiler/utils/GraphPpr.hs +++ b/compiler/GHC/Data/Graph/Ppr.hs @@ -1,17 +1,17 @@ -- | Pretty printing of graphs. -module GraphPpr ( - dumpGraph, - dotGraph -) +module GHC.Data.Graph.Ppr + ( dumpGraph + , dotGraph + ) where -import GhcPrelude +import GHC.Prelude -import GraphBase +import GHC.Data.Graph.Base -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Types.Unique.FM diff --git a/compiler/utils/UnVarGraph.hs b/compiler/GHC/Data/Graph/UnVar.hs index 20eff96c2c..4d1657ce62 100644 --- a/compiler/utils/UnVarGraph.hs +++ b/compiler/GHC/Data/Graph/UnVar.hs @@ -14,7 +14,7 @@ It does not normalize the graphs. This means that g `unionUnVarGraph` g is equal to g, but twice as expensive and large. -} -module UnVarGraph +module GHC.Data.Graph.UnVar ( UnVarSet , emptyUnVarSet, mkUnVarSet, varEnvDom, unionUnVarSet, unionUnVarSets , delUnVarSet @@ -28,13 +28,13 @@ module UnVarGraph , delNode ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Id import GHC.Types.Var.Env import GHC.Types.Unique.FM -import Outputable -import Bag +import GHC.Utils.Outputable +import GHC.Data.Bag import GHC.Types.Unique import qualified Data.IntSet as S diff --git a/compiler/utils/IOEnv.hs b/compiler/GHC/Data/IOEnv.hs index f9da146da5..345482094e 100644 --- a/compiler/utils/IOEnv.hs +++ b/compiler/GHC/Data/IOEnv.hs @@ -3,18 +3,18 @@ -- -- (c) The University of Glasgow 2002-2006 -- --- The IO Monad with an environment + +-- | The IO Monad with an environment -- -- The environment is passed around as a Reader monad but -- as its in the IO monad, mutable references can be used -- for updating state. -- - -module IOEnv ( +module GHC.Data.IOEnv ( IOEnv, -- Instance of Monad -- Monad utilities - module MonadUtils, + module GHC.Utils.Monad, -- Errors failM, failWithM, @@ -31,19 +31,19 @@ module IOEnv ( atomicUpdMutVar, atomicUpdMutVar' ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session -import Exception +import GHC.Utils.Exception import GHC.Types.Module -import Panic +import GHC.Utils.Panic import Data.IORef ( IORef, newIORef, readIORef, writeIORef, modifyIORef, atomicModifyIORef, atomicModifyIORef' ) import System.IO.Unsafe ( unsafeInterleaveIO ) import System.IO ( fixIO ) import Control.Monad -import MonadUtils +import GHC.Utils.Monad import Control.Applicative (Alternative(..)) ---------------------------------------------------------------------- diff --git a/compiler/utils/ListSetOps.hs b/compiler/GHC/Data/List/SetOps.hs index 85233c9533..2d916e9dd5 100644 --- a/compiler/utils/ListSetOps.hs +++ b/compiler/GHC/Data/List/SetOps.hs @@ -2,12 +2,14 @@ (c) The University of Glasgow 2006 (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -\section[ListSetOps]{Set-like operations on lists} -} {-# LANGUAGE CPP #-} -module ListSetOps ( +-- | Set-like operations on lists +-- +-- Avoid using them as much as possible +module GHC.Data.List.SetOps ( unionLists, minusList, deleteBys, -- Association lists @@ -23,10 +25,10 @@ module ListSetOps ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import qualified Data.List as L import qualified Data.List.NonEmpty as NE diff --git a/compiler/utils/Maybes.hs b/compiler/GHC/Data/Maybe.hs index 37acb25a1a..230468a20e 100644 --- a/compiler/utils/Maybes.hs +++ b/compiler/GHC/Data/Maybe.hs @@ -9,7 +9,7 @@ (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 -} -module Maybes ( +module GHC.Data.Maybe ( module Data.Maybe, MaybeErr(..), -- Instance of Monad @@ -25,13 +25,13 @@ module Maybes ( MaybeT(..), liftMaybeT, tryMaybeT ) where -import GhcPrelude +import GHC.Prelude import Control.Monad import Control.Monad.Trans.Maybe import Control.Exception (catch, SomeException(..)) import Data.Maybe -import Util (HasCallStack) +import GHC.Utils.Misc (HasCallStack) infixr 4 `orElse` diff --git a/compiler/utils/OrdList.hs b/compiler/GHC/Data/OrdList.hs index 8da5038b2c..5476055f05 100644 --- a/compiler/utils/OrdList.hs +++ b/compiler/GHC/Data/OrdList.hs @@ -3,16 +3,14 @@ (c) The AQUA Project, Glasgow University, 1993-1998 -This is useful, general stuff for the Native Code Generator. - -Provide trees (of instructions), so that lists of instructions -can be appended in linear time. -} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE BangPatterns #-} -module OrdList ( +-- | Provide trees (of instructions), so that lists of instructions can be +-- appended in linear time. +module GHC.Data.OrdList ( OrdList, nilOL, isNilOL, unitOL, appOL, consOL, snocOL, concatOL, lastOL, headOL, @@ -20,10 +18,10 @@ module OrdList ( strictlyEqOL, strictlyOrdOL ) where -import GhcPrelude +import GHC.Prelude import Data.Foldable -import Outputable +import GHC.Utils.Outputable import qualified Data.Semigroup as Semigroup diff --git a/compiler/utils/Pair.hs b/compiler/GHC/Data/Pair.hs index e9313f89b2..ae51c78edc 100644 --- a/compiler/utils/Pair.hs +++ b/compiler/GHC/Data/Pair.hs @@ -6,13 +6,21 @@ Traversable instances. {-# LANGUAGE CPP #-} {-# LANGUAGE DeriveFunctor #-} -module Pair ( Pair(..), unPair, toPair, swap, pLiftFst, pLiftSnd ) where +module GHC.Data.Pair + ( Pair(..) + , unPair + , toPair + , swap + , pLiftFst + , pLiftSnd + ) +where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import qualified Data.Semigroup as Semi data Pair a = Pair { pFst :: a, pSnd :: a } diff --git a/compiler/utils/Stream.hs b/compiler/GHC/Data/Stream.hs index 7eabbe1958..7996ee7343 100644 --- a/compiler/utils/Stream.hs +++ b/compiler/GHC/Data/Stream.hs @@ -2,18 +2,18 @@ -- -- (c) The University of Glasgow 2012 -- --- Monadic streams --- -- ----------------------------------------------------------------------------- -module Stream ( + +-- | Monadic streams +module GHC.Data.Stream ( Stream(..), yield, liftIO, collect, collect_, consume, fromList, - Stream.map, Stream.mapM, Stream.mapAccumL, Stream.mapAccumL_ + map, mapM, mapAccumL, mapAccumL_ ) where -import GhcPrelude +import GHC.Prelude hiding (map,mapM) -import Control.Monad +import Control.Monad hiding (mapM) -- | -- @Stream m a b@ is a computation in some Monad @m@ that delivers a sequence @@ -100,7 +100,7 @@ map f str = Stream $ do r <- runStream str case r of Left x -> return (Left x) - Right (a, str') -> return (Right (f a, Stream.map f str')) + Right (a, str') -> return (Right (f a, map f str')) -- | Apply a monadic operation to each element of a 'Stream', lazily mapM :: Monad m => (a -> m b) -> Stream m a x -> Stream m b x @@ -110,7 +110,7 @@ mapM f str = Stream $ do Left x -> return (Left x) Right (a, str') -> do b <- f a - return (Right (b, Stream.mapM f str')) + return (Right (b, mapM f str')) -- | analog of the list-based 'mapAccumL' on Streams. This is a simple -- way to map over a Stream while carrying some state around. diff --git a/compiler/utils/StringBuffer.hs b/compiler/GHC/Data/StringBuffer.hs index 91377cad17..8ac5d1ae07 100644 --- a/compiler/utils/StringBuffer.hs +++ b/compiler/GHC/Data/StringBuffer.hs @@ -11,7 +11,7 @@ Buffers for scanning string input stored in external arrays. -- We always optimise this, otherwise performance of a non-optimised -- compiler is severely affected -module StringBuffer +module GHC.Data.StringBuffer ( StringBuffer(..), -- non-abstract for vs\/HaskellService @@ -46,13 +46,13 @@ module StringBuffer #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Encoding -import FastString -import FastFunctions -import PlainPanic -import Util +import GHC.Utils.Encoding +import GHC.Data.FastString +import GHC.Utils.IO.Unsafe +import GHC.Utils.Panic.Plain +import GHC.Utils.Misc import Data.Maybe import Control.Exception diff --git a/compiler/utils/TrieMap.hs b/compiler/GHC/Data/TrieMap.hs index 815a060a0c..e2506e3d4c 100644 --- a/compiler/utils/TrieMap.hs +++ b/compiler/GHC/Data/TrieMap.hs @@ -9,7 +9,7 @@ {-# LANGUAGE TypeSynonymInstances #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} -module TrieMap( +module GHC.Data.TrieMap( -- * Maps over 'Maybe' values MaybeMap, -- * Maps over 'List' values @@ -29,7 +29,7 @@ module TrieMap( ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Literal import GHC.Types.Unique.DFM @@ -37,7 +37,7 @@ import GHC.Types.Unique( Unique ) import qualified Data.Map as Map import qualified Data.IntMap as IntMap -import Outputable +import GHC.Utils.Outputable import Control.Monad( (>=>) ) import Data.Kind( Type ) diff --git a/compiler/GHC/Driver/Backpack.hs b/compiler/GHC/Driver/Backpack.hs index 4f179f4aa1..4b15a4da9d 100644 --- a/compiler/GHC/Driver/Backpack.hs +++ b/compiler/GHC/Driver/Backpack.hs @@ -18,7 +18,7 @@ module GHC.Driver.Backpack (doBackpack) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -- In a separate module because it hooks into the parser. import GHC.Driver.Backpack.Syntax @@ -34,15 +34,15 @@ import GHC.Tc.Utils.Monad import GHC.Tc.Module import GHC.Types.Module import GHC.Driver.Types -import StringBuffer -import FastString -import ErrUtils +import GHC.Data.StringBuffer +import GHC.Data.FastString +import GHC.Utils.Error import GHC.Types.SrcLoc import GHC.Driver.Main import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import Outputable -import Maybes +import GHC.Utils.Outputable +import GHC.Data.Maybe import GHC.Parser.Header import GHC.Iface.Recomp import GHC.Driver.Make @@ -50,11 +50,11 @@ import GHC.Types.Unique.DSet import GHC.Builtin.Names import GHC.Types.Basic hiding (SuccessFlag(..)) import GHC.Driver.Finder -import Util +import GHC.Utils.Misc import qualified GHC.LanguageExtensions as LangExt -import Panic +import GHC.Utils.Panic import Data.List ( partition ) import System.Exit import Control.Monad diff --git a/compiler/GHC/Driver/Backpack/Syntax.hs b/compiler/GHC/Driver/Backpack/Syntax.hs index 7a119907da..bb459d8e35 100644 --- a/compiler/GHC/Driver/Backpack/Syntax.hs +++ b/compiler/GHC/Driver/Backpack/Syntax.hs @@ -16,14 +16,14 @@ module GHC.Driver.Backpack.Syntax ( LRenaming, Renaming(..), ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Phases import GHC.Hs import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module -import UnitInfo +import GHC.Unit.Info {- ************************************************************************ diff --git a/compiler/GHC/Driver/CmdLine.hs b/compiler/GHC/Driver/CmdLine.hs index 243831cfc5..2becd3e952 100644 --- a/compiler/GHC/Driver/CmdLine.hs +++ b/compiler/GHC/Driver/CmdLine.hs @@ -26,14 +26,14 @@ module GHC.Driver.CmdLine #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Util -import Outputable -import Panic -import Bag +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Utils.Panic +import GHC.Data.Bag import GHC.Types.SrcLoc -import Json +import GHC.Utils.Json import Data.Function import Data.List diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs index 3bce0db86d..7a768db4b9 100644 --- a/compiler/GHC/Driver/CodeOutput.hs +++ b/compiler/GHC/Driver/CodeOutput.hs @@ -15,7 +15,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.CmmToAsm ( nativeCodeGen ) import GHC.CmmToLlvm ( llvmCodeGen ) @@ -30,12 +30,12 @@ import GHC.Cmm ( RawCmmGroup ) import GHC.Cmm.CLabel import GHC.Driver.Types import GHC.Driver.Session -import Stream ( Stream ) -import qualified Stream +import GHC.Data.Stream ( Stream ) +import qualified GHC.Data.Stream as Stream import GHC.SysTools.FileCleanup -import ErrUtils -import Outputable +import GHC.Utils.Error +import GHC.Utils.Outputable import GHC.Types.Module import GHC.Types.SrcLoc import GHC.Types.CostCentre diff --git a/compiler/GHC/Driver/Finder.hs b/compiler/GHC/Driver/Finder.hs index 0a4b07509f..1118e764be 100644 --- a/compiler/GHC/Driver/Finder.hs +++ b/compiler/GHC/Driver/Finder.hs @@ -33,17 +33,17 @@ module GHC.Driver.Finder ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Module import GHC.Driver.Types import GHC.Driver.Packages -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Builtin.Names ( gHC_PRIM ) import GHC.Driver.Session -import Outputable -import Maybes ( expectJust ) +import GHC.Utils.Outputable as Outputable +import GHC.Data.Maybe ( expectJust ) import Data.IORef ( IORef, readIORef, atomicModifyIORef' ) import System.Directory diff --git a/compiler/GHC/Driver/Flags.hs b/compiler/GHC/Driver/Flags.hs index 2e867ac85f..b0be5f4bce 100644 --- a/compiler/GHC/Driver/Flags.hs +++ b/compiler/GHC/Driver/Flags.hs @@ -8,10 +8,10 @@ module GHC.Driver.Flags ) where -import GhcPrelude -import Outputable -import EnumSet -import Json +import GHC.Prelude +import GHC.Utils.Outputable +import GHC.Data.EnumSet as EnumSet +import GHC.Utils.Json -- | Debugging flags data DumpFlag diff --git a/compiler/GHC/Driver/Hooks.hs b/compiler/GHC/Driver/Hooks.hs index 35b06ca1df..b7915ed3af 100644 --- a/compiler/GHC/Driver/Hooks.hs +++ b/compiler/GHC/Driver/Hooks.hs @@ -28,7 +28,7 @@ module GHC.Driver.Hooks ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Driver.Pipeline.Monad @@ -36,9 +36,9 @@ import GHC.Driver.Types import GHC.Hs.Decls import GHC.Hs.Binds import GHC.Hs.Expr -import OrdList +import GHC.Data.OrdList import GHC.Tc.Types -import Bag +import GHC.Data.Bag import GHC.Types.Name.Reader import GHC.Types.Name import GHC.Types.Id @@ -52,7 +52,7 @@ import GHC.Types.Module import GHC.Core.TyCon import GHC.Types.CostCentre import GHC.Stg.Syntax -import Stream +import GHC.Data.Stream import GHC.Cmm import GHC.Hs.Extension diff --git a/compiler/GHC/Driver/Hooks.hs-boot b/compiler/GHC/Driver/Hooks.hs-boot index 40ee5560ee..48d6cdb1bc 100644 --- a/compiler/GHC/Driver/Hooks.hs-boot +++ b/compiler/GHC/Driver/Hooks.hs-boot @@ -1,6 +1,6 @@ module GHC.Driver.Hooks where -import GhcPrelude () +import GHC.Prelude () data Hooks diff --git a/compiler/GHC/Driver/Main.hs b/compiler/GHC/Driver/Main.hs index 5219ac6bd7..9199130996 100644 --- a/compiler/GHC/Driver/Main.hs +++ b/compiler/GHC/Driver/Main.hs @@ -84,7 +84,7 @@ module GHC.Driver.Main , hscAddSptEntries ) where -import GhcPrelude +import GHC.Prelude import Data.Data hiding (Fixity, TyCon) import Data.Maybe ( fromJust ) @@ -97,7 +97,7 @@ import GHC.Core.Tidy ( tidyExpr ) import GHC.Core.Type ( Type, Kind ) import GHC.Core.Lint ( lintInteractiveExpr ) import GHC.Types.Var.Env ( emptyTidyEnv ) -import Panic +import GHC.Utils.Panic import GHC.Core.ConLike import GHC.Parser.Annotation @@ -107,7 +107,7 @@ import GHC.Types.Name.Reader import GHC.Hs import GHC.Hs.Dump import GHC.Core -import StringBuffer +import GHC.Data.StringBuffer import GHC.Parser import GHC.Parser.Lexer as Lexer import GHC.Types.SrcLoc @@ -134,14 +134,14 @@ import GHC.Core.TyCon import GHC.Types.Name import GHC.Types.Name.Set import GHC.Cmm -import GHC.Cmm.Parser ( parseCmmFile ) +import GHC.Cmm.Parser ( parseCmmFile ) import GHC.Cmm.Info.Build import GHC.Cmm.Pipeline import GHC.Cmm.Info import GHC.Driver.CodeOutput import GHC.Core.InstEnv import GHC.Core.FamInstEnv -import Fingerprint ( Fingerprint ) +import GHC.Utils.Fingerprint ( Fingerprint ) import GHC.Driver.Hooks import GHC.Tc.Utils.Env import GHC.Builtin.Names @@ -149,20 +149,20 @@ import GHC.Driver.Plugins import GHC.Runtime.Loader ( initializePlugins ) import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error -import Outputable +import GHC.Utils.Outputable import GHC.Types.Name.Env -import HscStats ( ppSourceStats ) +import GHC.Hs.Stats ( ppSourceStats ) import GHC.Driver.Types -import FastString +import GHC.Data.FastString import GHC.Types.Unique.Supply -import Bag -import Exception -import qualified Stream -import Stream (Stream) +import GHC.Data.Bag +import GHC.Utils.Exception +import qualified GHC.Data.Stream as Stream +import GHC.Data.Stream (Stream) -import Util +import GHC.Utils.Misc import Data.List ( nub, isPrefixOf, partition ) import Control.Monad @@ -1767,7 +1767,7 @@ hscParsedDecls hsc_env decls = runInteractiveHsc hsc_env $ do return (new_tythings, new_ictxt) -- | Load the given static-pointer table entries into the interpreter. --- See Note [Grand plan for static forms] in StaticPtrTable. +-- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. hscAddSptEntries :: HscEnv -> [SptEntry] -> IO () hscAddSptEntries hsc_env entries = do let add_spt_entry :: SptEntry -> IO () diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index b81b045ed6..30e313ea46 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -33,41 +33,41 @@ module GHC.Driver.Make ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import qualified GHC.Runtime.Linker as Linker import GHC.Driver.Phases import GHC.Driver.Pipeline import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Finder import GHC.Driver.Monad import GHC.Parser.Header import GHC.Driver.Types import GHC.Types.Module -import GHC.IfaceToCore ( typecheckIface ) -import GHC.Tc.Utils.Monad ( initIfaceCheck ) +import GHC.IfaceToCore ( typecheckIface ) +import GHC.Tc.Utils.Monad ( initIfaceCheck ) import GHC.Driver.Main -import Bag ( unitBag, listToBag, unionManyBags, isEmptyBag ) +import GHC.Data.Bag ( unitBag, listToBag, unionManyBags, isEmptyBag ) import GHC.Types.Basic -import Digraph -import Exception ( tryIO, gbracket, gfinally ) -import FastString -import Maybes ( expectJust ) +import GHC.Data.Graph.Directed +import GHC.Utils.Exception ( tryIO, gbracket, gfinally ) +import GHC.Data.FastString +import GHC.Data.Maybe ( expectJust ) import GHC.Types.Name -import MonadUtils ( allM ) -import Outputable -import Panic +import GHC.Utils.Monad ( allM ) +import GHC.Utils.Outputable +import GHC.Utils.Panic import GHC.Types.SrcLoc -import StringBuffer +import GHC.Data.StringBuffer import GHC.Types.Unique.FM import GHC.Types.Unique.DSet import GHC.Tc.Utils.Backpack import GHC.Driver.Packages import GHC.Types.Unique.Set -import Util +import GHC.Utils.Misc import qualified GHC.LanguageExtensions as LangExt import GHC.Types.Name.Env import GHC.SysTools.FileCleanup @@ -76,7 +76,7 @@ import Data.Either ( rights, partitionEithers ) import qualified Data.Map as Map import Data.Map (Map) import qualified Data.Set as Set -import qualified FiniteMap as Map ( insertListWith ) +import qualified GHC.Data.FiniteMap as Map ( insertListWith ) import Control.Concurrent ( forkIOWithUnmask, killThread ) import qualified GHC.Conc as CC @@ -1505,7 +1505,7 @@ upsweep mHscMessage old_hpt stable_mods cleanup sccs = do -- Add any necessary entries to the static pointer -- table. See Note [Grand plan for static forms] in - -- StaticPtrTable. + -- GHC.Iface.Tidy.StaticPtrTable. when (hscTarget (hsc_dflags hsc_env4) == HscInterpreted) $ liftIO $ hscAddSptEntries hsc_env4 [ spt diff --git a/compiler/GHC/Driver/MakeFile.hs b/compiler/GHC/Driver/MakeFile.hs index d45b39e3b3..01af21d461 100644 --- a/compiler/GHC/Driver/MakeFile.hs +++ b/compiler/GHC/Driver/MakeFile.hs @@ -15,27 +15,27 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import qualified GHC import GHC.Driver.Monad import GHC.Driver.Session import GHC.Driver.Ways -import Util +import GHC.Utils.Misc import GHC.Driver.Types import qualified GHC.SysTools as SysTools import GHC.Types.Module -import Digraph ( SCC(..) ) +import GHC.Data.Graph.Directed ( SCC(..) ) import GHC.Driver.Finder -import Outputable -import Panic +import GHC.Utils.Outputable +import GHC.Utils.Panic import GHC.Types.SrcLoc import Data.List -import FastString +import GHC.Data.FastString import GHC.SysTools.FileCleanup -import Exception -import ErrUtils +import GHC.Utils.Exception +import GHC.Utils.Error import System.Directory import System.FilePath diff --git a/compiler/GHC/Driver/Monad.hs b/compiler/GHC/Driver/Monad.hs index 3825757ac6..d0c950baf5 100644 --- a/compiler/GHC/Driver/Monad.hs +++ b/compiler/GHC/Driver/Monad.hs @@ -23,13 +23,13 @@ module GHC.Driver.Monad ( WarnErrLogger, defaultWarnErrLogger ) where -import GhcPrelude +import GHC.Prelude -import MonadUtils +import GHC.Utils.Monad import GHC.Driver.Types import GHC.Driver.Session -import Exception -import ErrUtils +import GHC.Utils.Exception +import GHC.Utils.Error import Control.Monad import Data.IORef diff --git a/compiler/GHC/Driver/Packages.hs b/compiler/GHC/Driver/Packages.hs index 3e85251da2..a196467497 100644 --- a/compiler/GHC/Driver/Packages.hs +++ b/compiler/GHC/Driver/Packages.hs @@ -4,7 +4,7 @@ -- | Package manipulation module GHC.Driver.Packages ( - module UnitInfo, + module GHC.Unit.Info, -- * Reading the package config, and processing cmdline args PackageState(preloadPackages, explicitPackages, moduleNameProvidersMap, requirementContext), @@ -69,10 +69,10 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.PackageDb -import UnitInfo +import GHC.Unit.Info import GHC.Driver.Session import GHC.Driver.Ways import GHC.Types.Name ( Name, nameModule_maybe ) @@ -80,17 +80,17 @@ import GHC.Types.Unique.FM import GHC.Types.Unique.DFM import GHC.Types.Unique.Set import GHC.Types.Module -import Util -import Panic +import GHC.Utils.Misc +import GHC.Utils.Panic import GHC.Platform -import Outputable -import Maybes +import GHC.Utils.Outputable as Outputable +import GHC.Data.Maybe import System.Environment ( getEnv ) -import FastString -import ErrUtils ( debugTraceMsg, MsgDoc, dumpIfSet_dyn, +import GHC.Data.FastString +import GHC.Utils.Error ( debugTraceMsg, MsgDoc, dumpIfSet_dyn, withTiming, DumpFormat (..) ) -import Exception +import GHC.Utils.Exception import System.Directory import System.FilePath as FilePath diff --git a/compiler/GHC/Driver/Packages.hs-boot b/compiler/GHC/Driver/Packages.hs-boot index 96bb95deec..eab2ebd60f 100644 --- a/compiler/GHC/Driver/Packages.hs-boot +++ b/compiler/GHC/Driver/Packages.hs-boot @@ -1,6 +1,6 @@ module GHC.Driver.Packages where -import GhcPrelude -import FastString +import GHC.Prelude +import GHC.Data.FastString import {-# SOURCE #-} GHC.Driver.Session (DynFlags) import {-# SOURCE #-} GHC.Types.Module(ComponentId, UnitId, InstalledUnitId) data PackageState diff --git a/compiler/GHC/Driver/Phases.hs b/compiler/GHC/Driver/Phases.hs index d9059f65ec..cfca2e87c1 100644 --- a/compiler/GHC/Driver/Phases.hs +++ b/compiler/GHC/Driver/Phases.hs @@ -39,13 +39,13 @@ module GHC.Driver.Phases ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Platform import System.FilePath -import Binary -import Util +import GHC.Utils.Binary +import GHC.Utils.Misc ----------------------------------------------------------------------------- -- Phases diff --git a/compiler/GHC/Driver/Pipeline.hs b/compiler/GHC/Driver/Pipeline.hs index 1fc37e0662..c13f7aa0dc 100644 --- a/compiler/GHC/Driver/Pipeline.hs +++ b/compiler/GHC/Driver/Pipeline.hs @@ -36,7 +36,7 @@ module GHC.Driver.Pipeline ( #include <ghcplatform.h> #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Pipeline.Monad import GHC.Driver.Packages @@ -48,18 +48,18 @@ import GHC.SysTools.ExtraObj import GHC.Driver.Main import GHC.Driver.Finder import GHC.Driver.Types hiding ( Hsc ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Session -import Panic -import Util -import StringBuffer ( hGetStringBuffer, hPutStringBuffer ) -import GHC.Types.Basic ( SuccessFlag(..) ) -import Maybes ( expectJust ) +import GHC.Utils.Panic +import GHC.Utils.Misc +import GHC.Data.StringBuffer ( hGetStringBuffer, hPutStringBuffer ) +import GHC.Types.Basic ( SuccessFlag(..) ) +import GHC.Data.Maybe ( expectJust ) import GHC.Types.SrcLoc -import GHC.CmmToLlvm ( llvmFixupAsm, llvmVersionList ) -import MonadUtils +import GHC.CmmToLlvm ( llvmFixupAsm, llvmVersionList ) +import GHC.Utils.Monad import GHC.Platform import GHC.Tc.Types import GHC.Driver.Hooks @@ -67,12 +67,12 @@ import qualified GHC.LanguageExtensions as LangExt import GHC.SysTools.FileCleanup import GHC.SysTools.Ar import GHC.Settings -import Bag ( unitBag ) -import FastString ( mkFastString ) -import GHC.Iface.Make ( mkFullIface ) -import UpdateCafInfos ( updateModDetailsCafInfos ) +import GHC.Data.Bag ( unitBag ) +import GHC.Data.FastString ( mkFastString ) +import GHC.Iface.Make ( mkFullIface ) +import GHC.Iface.UpdateCafInfos ( updateModDetailsCafInfos ) -import Exception +import GHC.Utils.Exception as Exception import System.Directory import System.FilePath import System.IO diff --git a/compiler/GHC/Driver/Pipeline/Monad.hs b/compiler/GHC/Driver/Pipeline/Monad.hs index 753f829f3c..bf22ae6e9d 100644 --- a/compiler/GHC/Driver/Pipeline/Monad.hs +++ b/compiler/GHC/Driver/Pipeline/Monad.hs @@ -11,10 +11,10 @@ module GHC.Driver.Pipeline.Monad ( , pipeStateDynFlags, pipeStateModIface ) where -import GhcPrelude +import GHC.Prelude -import MonadUtils -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Driver.Session import GHC.Driver.Phases import GHC.Driver.Types diff --git a/compiler/GHC/Driver/Plugins.hs b/compiler/GHC/Driver/Plugins.hs index d9e29d451b..4d4f9eab77 100644 --- a/compiler/GHC/Driver/Plugins.hs +++ b/compiler/GHC/Driver/Plugins.hs @@ -47,7 +47,7 @@ module GHC.Driver.Plugins ( , mapPlugins, withPlugins, withPlugins_ ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.Opt.Monad ( CoreToDo, CoreM ) import qualified GHC.Tc.Types @@ -59,9 +59,9 @@ import GHC.Driver.Types import GHC.Driver.Monad import GHC.Driver.Phases import GHC.Types.Module ( ModuleName, Module(moduleName)) -import Fingerprint +import GHC.Utils.Fingerprint import Data.List (sort) -import Outputable (Outputable(..), text, (<+>)) +import GHC.Utils.Outputable (Outputable(..), text, (<+>)) --Qualified import so we can define a Semigroup instance -- but it doesn't clash with Outputable.<> diff --git a/compiler/GHC/Driver/Plugins.hs-boot b/compiler/GHC/Driver/Plugins.hs-boot index 41a0c115d2..7b5f8ca161 100644 --- a/compiler/GHC/Driver/Plugins.hs-boot +++ b/compiler/GHC/Driver/Plugins.hs-boot @@ -2,7 +2,7 @@ -- exposed without importing all of its implementation. module GHC.Driver.Plugins where -import GhcPrelude () +import GHC.Prelude () data Plugin diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 7efba2bcea..fe35d19ee5 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -238,7 +238,7 @@ module GHC.Driver.Session ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.UniqueSubdir (uniqueSubdir) @@ -251,27 +251,28 @@ import GHC.Driver.Phases ( Phase(..), phaseInputExt ) import GHC.Driver.Flags import GHC.Driver.Ways import Config -import CliOption +import GHC.Utils.CliOption import GHC.Driver.CmdLine hiding (WarnReason(..)) import qualified GHC.Driver.CmdLine as Cmd import GHC.Settings.Constants -import Panic -import qualified PprColour as Col -import Util -import Maybes -import MonadUtils -import qualified Pretty +import GHC.Utils.Panic +import qualified GHC.Utils.Ppr.Colour as Col +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Utils.Monad +import qualified GHC.Utils.Ppr as Pretty import GHC.Types.SrcLoc import GHC.Types.Basic ( Alignment, alignmentOf, IntWithInf, treatZeroAsInf ) -import FastString -import Fingerprint -import Outputable +import GHC.Data.FastString +import GHC.Utils.Fingerprint +import GHC.Utils.Outputable import GHC.Settings -import {-# SOURCE #-} ErrUtils ( Severity(..), MsgDoc, mkLocMessageAnn +import {-# SOURCE #-} GHC.Utils.Error + ( Severity(..), MsgDoc, mkLocMessageAnn , getCaretDiagnostic, DumpAction, TraceAction , defaultDumpAction, defaultTraceAction ) -import Json +import GHC.Utils.Json import GHC.SysTools.Terminal ( stderrSupportsAnsiColors ) import GHC.SysTools.BaseDir ( expandToolDir, expandTopDir ) @@ -300,8 +301,8 @@ import System.IO.Error import Text.ParserCombinators.ReadP hiding (char) import Text.ParserCombinators.ReadP as R -import EnumSet (EnumSet) -import qualified EnumSet +import GHC.Data.EnumSet (EnumSet) +import qualified GHC.Data.EnumSet as EnumSet import GHC.Foreign (withCString, peekCString) import qualified GHC.LanguageExtensions as LangExt @@ -702,7 +703,7 @@ data DynFlags = DynFlags { ghciHistSize :: Int, - -- | MsgDoc output action: use "ErrUtils" instead of this if you can + -- | MsgDoc output action: use "GHC.Utils.Error" instead of this if you can log_action :: LogAction, dump_action :: DumpAction, trace_action :: TraceAction, diff --git a/compiler/GHC/Driver/Session.hs-boot b/compiler/GHC/Driver/Session.hs-boot index 2bc44dc3c6..509535ba71 100644 --- a/compiler/GHC/Driver/Session.hs-boot +++ b/compiler/GHC/Driver/Session.hs-boot @@ -1,8 +1,8 @@ module GHC.Driver.Session where -import GhcPrelude +import GHC.Prelude import GHC.Platform -import {-# SOURCE #-} Outputable +import {-# SOURCE #-} GHC.Utils.Outputable data DynFlags diff --git a/compiler/GHC/Driver/Types.hs b/compiler/GHC/Driver/Types.hs index 581a90ea1d..b4f07618f6 100644 --- a/compiler/GHC/Driver/Types.hs +++ b/compiler/GHC/Driver/Types.hs @@ -159,7 +159,7 @@ module GHC.Driver.Types ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.ByteCode.Types import GHC.Runtime.Eval.Types ( Resume ) @@ -202,21 +202,21 @@ import GHC.Driver.Phases import qualified GHC.Driver.Phases as Phase import GHC.Types.Basic import GHC.Iface.Syntax -import Maybes -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Types.Unique import GHC.Types.Unique.DFM -import FastString -import StringBuffer ( StringBuffer ) -import Fingerprint -import MonadUtils -import Bag -import Binary -import ErrUtils +import GHC.Data.FastString +import GHC.Data.StringBuffer ( StringBuffer ) +import GHC.Utils.Fingerprint +import GHC.Utils.Monad +import GHC.Data.Bag +import GHC.Utils.Binary +import GHC.Utils.Error import GHC.Types.Name.Cache import GHC.Platform -import Util +import GHC.Utils.Misc import GHC.Types.Unique.DSet import GHC.Serialized ( Serialized ) import qualified GHC.LanguageExtensions as LangExt @@ -227,7 +227,7 @@ import Data.IORef import Data.Map ( Map ) import qualified Data.Map as Map import Data.Time -import Exception +import GHC.Utils.Exception import System.FilePath import Control.DeepSeq import Control.Monad.Trans.Reader @@ -1524,7 +1524,7 @@ data CgGuts cg_spt_entries :: [SptEntry] -- ^ Static pointer table entries for static forms defined in -- the module. - -- See Note [Grand plan for static forms] in StaticPtrTable + -- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable } ----------------------------------- diff --git a/compiler/GHC/Driver/Ways.hs b/compiler/GHC/Driver/Ways.hs index 1b9845850f..eae86864d4 100644 --- a/compiler/GHC/Driver/Ways.hs +++ b/compiler/GHC/Driver/Ways.hs @@ -37,7 +37,7 @@ module GHC.Driver.Ways ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Driver.Flags diff --git a/compiler/GHC/Hs.hs b/compiler/GHC/Hs.hs index 72710c6830..59fe3e36b0 100644 --- a/compiler/GHC/Hs.hs +++ b/compiler/GHC/Hs.hs @@ -35,7 +35,7 @@ module GHC.Hs ( ) where -- friends: -import GhcPrelude +import GHC.Prelude import GHC.Hs.Decls import GHC.Hs.Binds @@ -51,7 +51,7 @@ import GHC.Hs.Doc import GHC.Hs.Instances () -- For Data instances -- others: -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Types.Module ( ModuleName ) diff --git a/compiler/GHC/Hs/Binds.hs b/compiler/GHC/Hs/Binds.hs index 5068f082ce..0252656203 100644 --- a/compiler/GHC/Hs/Binds.hs +++ b/compiler/GHC/Hs/Binds.hs @@ -23,7 +23,7 @@ Datatype for: @BindGroup@, @Bind@, @Sig@, @Bind@. module GHC.Hs.Binds where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Hs.Expr ( pprExpr, LHsExpr, MatchGroup, pprFunBind, @@ -37,12 +37,12 @@ import GHC.Tc.Types.Evidence import GHC.Core.Type import GHC.Types.Name.Set import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc as SrcLoc import GHC.Types.Var -import Bag -import FastString -import BooleanFormula (LBooleanFormula) +import GHC.Data.Bag +import GHC.Data.FastString +import GHC.Data.BooleanFormula (LBooleanFormula) import Data.Data hiding ( Fixity ) import Data.List hiding ( foldr ) diff --git a/compiler/GHC/Hs/Decls.hs b/compiler/GHC/Hs/Decls.hs index 0be89127a5..f0ffd06307 100644 --- a/compiler/GHC/Hs/Decls.hs +++ b/compiler/GHC/Hs/Decls.hs @@ -94,7 +94,7 @@ module GHC.Hs.Decls ( ) where -- friends: -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Hs.Expr( HsExpr, HsSplice, pprExpr, pprSpliceDecl ) @@ -112,13 +112,13 @@ import GHC.Types.Name.Set -- others: import GHC.Core.Class -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.SrcLoc import GHC.Core.Type -import Bag -import Maybes +import GHC.Data.Bag +import GHC.Data.Maybe import Data.Data hiding (TyCon,Fixity, Infix) {- diff --git a/compiler/GHC/Hs/Doc.hs b/compiler/GHC/Hs/Doc.hs index 7da56b1524..9a5035b46e 100644 --- a/compiler/GHC/Hs/Doc.hs +++ b/compiler/GHC/Hs/Doc.hs @@ -23,13 +23,13 @@ module GHC.Hs.Doc #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Binary -import Encoding -import FastFunctions +import GHC.Utils.Binary +import GHC.Utils.Encoding +import GHC.Utils.IO.Unsafe import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.SrcLoc import Data.ByteString (ByteString) diff --git a/compiler/GHC/Hs/Dump.hs b/compiler/GHC/Hs/Dump.hs index 2fe8711570..ee9df10c5d 100644 --- a/compiler/GHC/Hs/Dump.hs +++ b/compiler/GHC/Hs/Dump.hs @@ -15,12 +15,12 @@ module GHC.Hs.Dump ( BlankSrcSpan(..), ) where -import GhcPrelude +import GHC.Prelude import Data.Data hiding (Fixity) -import Bag +import GHC.Data.Bag import GHC.Types.Basic -import FastString +import GHC.Data.FastString import GHC.Types.Name.Set import GHC.Types.Name import GHC.Core.DataCon @@ -28,7 +28,7 @@ import GHC.Types.SrcLoc import GHC.Hs import GHC.Types.Var import GHC.Types.Module -import Outputable +import GHC.Utils.Outputable import qualified Data.ByteString as B diff --git a/compiler/GHC/Hs/Expr.hs b/compiler/GHC/Hs/Expr.hs index 290a9716e2..a03c0aa50d 100644 --- a/compiler/GHC/Hs/Expr.hs +++ b/compiler/GHC/Hs/Expr.hs @@ -26,7 +26,7 @@ module GHC.Hs.Expr where #include "HsVersions.h" -- friends: -import GhcPrelude +import GHC.Prelude import GHC.Hs.Decls import GHC.Hs.Pat @@ -43,9 +43,9 @@ import GHC.Types.Name.Set import GHC.Types.Basic import GHC.Core.ConLike import GHC.Types.SrcLoc -import Util -import Outputable -import FastString +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Core.Type import GHC.Builtin.Types (mkTupleStr) import GHC.Tc.Utils.TcType (TcType) diff --git a/compiler/GHC/Hs/Expr.hs-boot b/compiler/GHC/Hs/Expr.hs-boot index 87a4a2b38e..ccfe2cb65d 100644 --- a/compiler/GHC/Hs/Expr.hs-boot +++ b/compiler/GHC/Hs/Expr.hs-boot @@ -11,7 +11,7 @@ module GHC.Hs.Expr where import GHC.Types.SrcLoc ( Located ) -import Outputable ( SDoc, Outputable ) +import GHC.Utils.Outputable ( SDoc, Outputable ) import {-# SOURCE #-} GHC.Hs.Pat ( LPat ) import GHC.Types.Basic ( SpliceExplicitFlag(..)) import GHC.Hs.Extension ( OutputableBndrId, GhcPass ) diff --git a/compiler/GHC/Hs/Extension.hs b/compiler/GHC/Hs/Extension.hs index b24bdf19b8..57cd67e65a 100644 --- a/compiler/GHC/Hs/Extension.hs +++ b/compiler/GHC/Hs/Extension.hs @@ -25,13 +25,13 @@ module GHC.Hs.Extension where -- This module captures the type families to precisely identify the extension -- points for GHC.Hs syntax -import GhcPrelude +import GHC.Prelude import Data.Data hiding ( Fixity ) import GHC.Types.Name import GHC.Types.Name.Reader import GHC.Types.Var -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc (Located) import Data.Kind diff --git a/compiler/GHC/Hs/ImpExp.hs b/compiler/GHC/Hs/ImpExp.hs index d4ed3e64a0..813d0ef9bf 100644 --- a/compiler/GHC/Hs/ImpExp.hs +++ b/compiler/GHC/Hs/ImpExp.hs @@ -16,7 +16,7 @@ GHC.Hs.ImpExp: Abstract syntax: imports, exports, interfaces module GHC.Hs.ImpExp where -import GhcPrelude +import GHC.Prelude import GHC.Types.Module ( ModuleName ) import GHC.Hs.Doc ( HsDocString ) @@ -24,8 +24,8 @@ import GHC.Types.Name.Occurrence ( HasOccName(..), isTcOcc, isSymOcc ) import GHC.Types.Basic ( SourceText(..), StringLiteral(..), pprWithSourceText ) import GHC.Types.FieldLabel ( FieldLbl(..) ) -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.SrcLoc import GHC.Hs.Extension diff --git a/compiler/GHC/Hs/Instances.hs b/compiler/GHC/Hs/Instances.hs index db7a46805c..6eca193bb8 100644 --- a/compiler/GHC/Hs/Instances.hs +++ b/compiler/GHC/Hs/Instances.hs @@ -16,7 +16,7 @@ module GHC.Hs.Instances where import Data.Data hiding ( Fixity ) -import GhcPrelude +import GHC.Prelude import GHC.Hs.Extension import GHC.Hs.Binds import GHC.Hs.Decls diff --git a/compiler/GHC/Hs/Lit.hs b/compiler/GHC/Hs/Lit.hs index 964df0d356..75e5c1d315 100644 --- a/compiler/GHC/Hs/Lit.hs +++ b/compiler/GHC/Hs/Lit.hs @@ -19,7 +19,7 @@ module GHC.Hs.Lit where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Hs.Expr( HsExpr, pprExpr ) import GHC.Types.Basic @@ -27,8 +27,8 @@ import GHC.Types.Basic , negateFractionalLit, SourceText(..), pprWithSourceText , PprPrec(..), topPrec ) import GHC.Core.Type -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Hs.Extension import Data.ByteString (ByteString) diff --git a/compiler/GHC/Hs/Pat.hs b/compiler/GHC/Hs/Pat.hs index c92967db81..4f73aa3e98 100644 --- a/compiler/GHC/Hs/Pat.hs +++ b/compiler/GHC/Hs/Pat.hs @@ -50,7 +50,7 @@ module GHC.Hs.Pat ( pprParendLPat, pprConArgs ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Hs.Expr (SyntaxExpr, LHsExpr, HsSplice, pprLExpr, pprSplice) @@ -69,11 +69,11 @@ import GHC.Types.Name.Reader ( RdrName ) import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.TyCon -import Outputable +import GHC.Utils.Outputable import GHC.Core.Type import GHC.Types.SrcLoc -import Bag -- collect ev vars from pats -import Maybes +import GHC.Data.Bag -- collect ev vars from pats +import GHC.Data.Maybe import GHC.Types.Name (Name) -- libraries: import Data.Data hiding (TyCon,Fixity) diff --git a/compiler/GHC/Hs/Pat.hs-boot b/compiler/GHC/Hs/Pat.hs-boot index c7ff0a892e..1a783e3c7e 100644 --- a/compiler/GHC/Hs/Pat.hs-boot +++ b/compiler/GHC/Hs/Pat.hs-boot @@ -9,7 +9,7 @@ module GHC.Hs.Pat where -import Outputable +import GHC.Utils.Outputable import GHC.Hs.Extension ( OutputableBndrId, GhcPass, XRec ) import Data.Kind diff --git a/compiler/main/HscStats.hs b/compiler/GHC/Hs/Stats.hs index 7e0b07ede6..5b76372f37 100644 --- a/compiler/main/HscStats.hs +++ b/compiler/GHC/Hs/Stats.hs @@ -8,15 +8,15 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} -module HscStats ( ppSourceStats ) where +module GHC.Hs.Stats ( ppSourceStats ) where -import GhcPrelude +import GHC.Prelude -import Bag +import GHC.Data.Bag import GHC.Hs -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc import Data.Char diff --git a/compiler/GHC/Hs/Types.hs b/compiler/GHC/Hs/Types.hs index 38a0300a8f..fd782c6348 100644 --- a/compiler/GHC/Hs/Types.hs +++ b/compiler/GHC/Hs/Types.hs @@ -72,7 +72,7 @@ module GHC.Hs.Types ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Hs.Expr ( HsSplice, pprSplice ) @@ -88,10 +88,10 @@ import GHC.Core.Type import GHC.Hs.Doc import GHC.Types.Basic import GHC.Types.SrcLoc -import Outputable -import FastString -import Maybes( isJust ) -import Util ( count ) +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Maybe( isJust ) +import GHC.Utils.Misc ( count ) import Data.Data hiding ( Fixity, Prefix, Infix ) diff --git a/compiler/GHC/Hs/Utils.hs b/compiler/GHC/Hs/Utils.hs index 75ef5b06bf..6e89b6844a 100644 --- a/compiler/GHC/Hs/Utils.hs +++ b/compiler/GHC/Hs/Utils.hs @@ -104,7 +104,7 @@ module GHC.Hs.Utils( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs.Decls import GHC.Hs.Binds @@ -130,10 +130,10 @@ import GHC.Types.Name.Set hiding ( unitFV ) import GHC.Types.Name.Env import GHC.Types.Basic import GHC.Types.SrcLoc -import FastString -import Util -import Bag -import Outputable +import GHC.Data.FastString +import GHC.Utils.Misc +import GHC.Data.Bag +import GHC.Utils.Outputable import GHC.Settings.Constants import Data.Either diff --git a/compiler/GHC/HsToCore.hs b/compiler/GHC/HsToCore.hs index ad445bf8bc..7474678e3c 100644 --- a/compiler/GHC/HsToCore.hs +++ b/compiler/GHC/HsToCore.hs @@ -18,7 +18,7 @@ module GHC.HsToCore ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.HsToCore.Usage import GHC.Driver.Session @@ -57,14 +57,14 @@ import GHC.Types.Basic import GHC.Core.Opt.Monad ( CoreToDo(..) ) import GHC.Core.Lint ( endPassIO ) import GHC.Types.Var.Set -import FastString -import ErrUtils -import Outputable +import GHC.Data.FastString +import GHC.Utils.Error +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.HsToCore.Coverage -import Util -import MonadUtils -import OrdList +import GHC.Utils.Misc +import GHC.Utils.Monad +import GHC.Data.OrdList import GHC.HsToCore.Docs import Data.List diff --git a/compiler/GHC/HsToCore/Arrows.hs b/compiler/GHC/HsToCore/Arrows.hs index e3ac5a046b..733ae86d6e 100644 --- a/compiler/GHC/HsToCore/Arrows.hs +++ b/compiler/GHC/HsToCore/Arrows.hs @@ -16,7 +16,7 @@ module GHC.HsToCore.Arrows ( dsProcExpr ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.HsToCore.Match import GHC.HsToCore.Utils @@ -50,12 +50,12 @@ import GHC.Core.ConLike import GHC.Builtin.Types import GHC.Types.Basic import GHC.Builtin.Names -import Outputable +import GHC.Utils.Outputable import GHC.Types.Var.Set import GHC.Types.SrcLoc -import ListSetOps( assocMaybe ) +import GHC.Data.List.SetOps( assocMaybe ) import Data.List -import Util +import GHC.Utils.Misc import GHC.Types.Unique.DSet data DsCmdEnv = DsCmdEnv { diff --git a/compiler/GHC/HsToCore/Binds.hs b/compiler/GHC/HsToCore/Binds.hs index cd2a786445..7bc6fe2512 100644 --- a/compiler/GHC/HsToCore/Binds.hs +++ b/compiler/GHC/HsToCore/Binds.hs @@ -25,7 +25,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr ) import {-# SOURCE #-} GHC.HsToCore.Match ( matchWrapper ) @@ -44,7 +44,7 @@ import GHC.Core.Utils import GHC.Core.Arity ( etaExpand ) import GHC.Core.Unfold import GHC.Core.FVs -import Digraph +import GHC.Data.Graph.Directed import GHC.Core.Predicate import GHC.Builtin.Names @@ -61,18 +61,18 @@ import GHC.Types.Var.Set import GHC.Core.Rules import GHC.Types.Var.Env import GHC.Types.Var( EvVar ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module import GHC.Types.SrcLoc -import Maybes -import OrdList -import Bag +import GHC.Data.Maybe +import GHC.Data.OrdList +import GHC.Data.Bag import GHC.Types.Basic import GHC.Driver.Session -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Types.Unique.Set( nonDetEltsUniqSet ) -import MonadUtils +import GHC.Utils.Monad import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Data.List.NonEmpty ( nonEmpty ) @@ -1173,7 +1173,7 @@ mk_ev_binds ds_binds coVarsOfType (varType var) } -- It's OK to use nonDetEltsUniqSet here as stronglyConnCompFromEdgedVertices -- is still deterministic even if the edges are in nondeterministic order - -- as explained in Note [Deterministic SCC] in Digraph. + -- as explained in Note [Deterministic SCC] in GHC.Data.Graph.Directed. ds_scc (AcyclicSCC (v,r)) = NonRec v r ds_scc (CyclicSCC prs) = Rec prs diff --git a/compiler/GHC/HsToCore/Coverage.hs b/compiler/GHC/HsToCore/Coverage.hs index 196c4a0cf0..b2f5c4d15e 100644 --- a/compiler/GHC/HsToCore/Coverage.hs +++ b/compiler/GHC/HsToCore/Coverage.hs @@ -12,7 +12,7 @@ module GHC.HsToCore.Coverage (addTicksToBinds, hpcInitCode) where -import GhcPrelude as Prelude +import GHC.Prelude as Prelude import qualified GHC.Runtime.Interpreter as GHCi import GHCi.RemoteTypes @@ -22,29 +22,29 @@ import GHC.Stack.CCS import GHC.Core.Type import GHC.Hs import GHC.Types.Module as Module -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Driver.Session import GHC.Core.ConLike import Control.Monad import GHC.Types.SrcLoc -import ErrUtils +import GHC.Utils.Error import GHC.Types.Name.Set hiding (FreeVars) import GHC.Types.Name -import Bag +import GHC.Data.Bag import GHC.Types.CostCentre import GHC.Types.CostCentre.State import GHC.Core import GHC.Types.Id import GHC.Types.Var.Set import Data.List -import FastString +import GHC.Data.FastString import GHC.Driver.Types import GHC.Core.TyCon import GHC.Types.Basic -import MonadUtils -import Maybes +import GHC.Utils.Monad +import GHC.Data.Maybe import GHC.Cmm.CLabel -import Util +import GHC.Utils.Misc import Data.Time import System.Directory diff --git a/compiler/GHC/HsToCore/Docs.hs b/compiler/GHC/HsToCore/Docs.hs index 30cf626d6d..c14c2ac7e8 100644 --- a/compiler/GHC/HsToCore/Docs.hs +++ b/compiler/GHC/HsToCore/Docs.hs @@ -8,8 +8,8 @@ module GHC.HsToCore.Docs (extractDocs) where -import GhcPrelude -import Bag +import GHC.Prelude +import GHC.Data.Bag import GHC.Hs.Binds import GHC.Hs.Doc import GHC.Hs.Decls diff --git a/compiler/GHC/HsToCore/Expr.hs b/compiler/GHC/HsToCore/Expr.hs index 8e4313f80d..2ea1c17e04 100644 --- a/compiler/GHC/HsToCore/Expr.hs +++ b/compiler/GHC/HsToCore/Expr.hs @@ -22,7 +22,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.HsToCore.Match import GHC.HsToCore.Match.Literal @@ -60,12 +60,12 @@ import GHC.Core.TyCo.Ppr( pprWithTYPE ) import GHC.Builtin.Types import GHC.Builtin.Names import GHC.Types.Basic -import Maybes +import GHC.Data.Maybe import GHC.Types.Var.Env import GHC.Types.SrcLoc -import Util -import Bag -import Outputable +import GHC.Utils.Misc +import GHC.Data.Bag +import GHC.Utils.Outputable as Outputable import GHC.Core.PatSyn import Control.Monad @@ -471,7 +471,7 @@ dsExpr (ArithSeq expr witness seq) Static Pointers ~~~~~~~~~~~~~~~ -See Note [Grand plan for static forms] in StaticPtrTable for an overview. +See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable for an overview. g = ... static f ... ==> diff --git a/compiler/GHC/HsToCore/Foreign/Call.hs b/compiler/GHC/HsToCore/Foreign/Call.hs index b3ecd82cf8..9589c375e8 100644 --- a/compiler/GHC/HsToCore/Foreign/Call.hs +++ b/compiler/GHC/HsToCore/Foreign/Call.hs @@ -22,7 +22,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Core @@ -47,8 +47,8 @@ import GHC.Types.Basic import GHC.Types.Literal import GHC.Builtin.Names import GHC.Driver.Session -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import Data.Maybe diff --git a/compiler/GHC/HsToCore/Foreign/Decl.hs b/compiler/GHC/HsToCore/Foreign/Decl.hs index dadfc40005..9eb867a098 100644 --- a/compiler/GHC/HsToCore/Foreign/Decl.hs +++ b/compiler/GHC/HsToCore/Foreign/Decl.hs @@ -16,7 +16,7 @@ Desugaring foreign declarations (see also GHC.HsToCore.Foreign.Call). module GHC.HsToCore.Foreign.Decl ( dsForeigns ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad -- temp @@ -48,14 +48,14 @@ import GHC.Builtin.Types.Prim import GHC.Builtin.Names import GHC.Types.Basic import GHC.Types.SrcLoc -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Driver.Session import GHC.Platform -import OrdList -import Util +import GHC.Data.OrdList +import GHC.Utils.Misc import GHC.Driver.Hooks -import Encoding +import GHC.Utils.Encoding import Data.Maybe import Data.List diff --git a/compiler/GHC/HsToCore/GuardedRHSs.hs b/compiler/GHC/HsToCore/GuardedRHSs.hs index 8ee3661da6..68162187b8 100644 --- a/compiler/GHC/HsToCore/GuardedRHSs.hs +++ b/compiler/GHC/HsToCore/GuardedRHSs.hs @@ -13,7 +13,7 @@ module GHC.HsToCore.GuardedRHSs ( dsGuarded, dsGRHSs, isTrueLHsExpr ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr, dsLocalBinds ) import {-# SOURCE #-} GHC.HsToCore.Match ( matchSinglePatVar ) @@ -27,9 +27,9 @@ import GHC.HsToCore.Monad import GHC.HsToCore.Utils import GHC.HsToCore.PmCheck.Types ( Deltas, initDeltas ) import GHC.Core.Type ( Type ) -import Util +import GHC.Utils.Misc import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import Control.Monad ( zipWithM ) import Data.List.NonEmpty ( NonEmpty, toList ) diff --git a/compiler/GHC/HsToCore/ListComp.hs b/compiler/GHC/HsToCore/ListComp.hs index 9db596fb52..9d6a9bb462 100644 --- a/compiler/GHC/HsToCore/ListComp.hs +++ b/compiler/GHC/HsToCore/ListComp.hs @@ -14,7 +14,7 @@ module GHC.HsToCore.ListComp ( dsListComp, dsMonadComp ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.HsToCore.Expr ( dsHandleMonadicFailure, dsExpr, dsLExpr, dsLExprNoLP, dsLocalBinds, dsSyntaxExpr ) @@ -34,10 +34,10 @@ import GHC.Builtin.Types import GHC.HsToCore.Match import GHC.Builtin.Names import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Tc.Utils.TcType -import ListSetOps( getNth ) -import Util +import GHC.Data.List.SetOps( getNth ) +import GHC.Utils.Misc {- List comprehensions may be desugared in one of two ways: ``ordinary'' diff --git a/compiler/GHC/HsToCore/Match.hs b/compiler/GHC/HsToCore/Match.hs index b9e053c005..60b694ff9d 100644 --- a/compiler/GHC/HsToCore/Match.hs +++ b/compiler/GHC/HsToCore/Match.hs @@ -23,7 +23,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import {-#SOURCE#-} GHC.HsToCore.Expr (dsLExpr, dsSyntaxExpr) @@ -54,12 +54,12 @@ import GHC.Core.Coercion ( eqCoercion ) import GHC.Core.TyCon ( isNewTyCon ) import GHC.Builtin.Types import GHC.Types.SrcLoc -import Maybes -import Util +import GHC.Data.Maybe +import GHC.Utils.Misc import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Types.Basic ( isGenerated, il_value, fl_value ) -import FastString +import GHC.Data.FastString import GHC.Types.Unique import GHC.Types.Unique.DFM diff --git a/compiler/GHC/HsToCore/Match.hs-boot b/compiler/GHC/HsToCore/Match.hs-boot index 9466cbdb17..b42c84e10a 100644 --- a/compiler/GHC/HsToCore/Match.hs-boot +++ b/compiler/GHC/HsToCore/Match.hs-boot @@ -1,6 +1,6 @@ module GHC.HsToCore.Match where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var ( Id ) import GHC.Tc.Utils.TcType ( Type ) import GHC.HsToCore.Monad ( DsM, EquationInfo, MatchResult ) diff --git a/compiler/GHC/HsToCore/Match/Constructor.hs b/compiler/GHC/HsToCore/Match/Constructor.hs index c7022d6b1d..9c7ad46c22 100644 --- a/compiler/GHC/HsToCore/Match/Constructor.hs +++ b/compiler/GHC/HsToCore/Match/Constructor.hs @@ -16,7 +16,7 @@ module GHC.HsToCore.Match.Constructor ( matchConFamily, matchPatSyn ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.HsToCore.Match ( match ) @@ -29,12 +29,12 @@ import GHC.HsToCore.Monad import GHC.HsToCore.Utils import GHC.Core ( CoreExpr ) import GHC.Core.Make ( mkCoreLets ) -import Util +import GHC.Utils.Misc import GHC.Types.Id import GHC.Types.Name.Env import GHC.Types.FieldLabel ( flSelector ) import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import Control.Monad(liftM) import Data.List (groupBy) import Data.List.NonEmpty (NonEmpty(..)) diff --git a/compiler/GHC/HsToCore/Match/Literal.hs b/compiler/GHC/HsToCore/Match/Literal.hs index 93b042e033..600af91468 100644 --- a/compiler/GHC/HsToCore/Match/Literal.hs +++ b/compiler/GHC/HsToCore/Match/Literal.hs @@ -23,7 +23,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import {-# SOURCE #-} GHC.HsToCore.Match ( match ) @@ -49,11 +49,11 @@ import GHC.Builtin.Types.Prim import GHC.Types.Literal import GHC.Types.SrcLoc import Data.Ratio -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Basic import GHC.Driver.Session -import Util -import FastString +import GHC.Utils.Misc +import GHC.Data.FastString import qualified GHC.LanguageExtensions as LangExt import Control.Monad diff --git a/compiler/GHC/HsToCore/Monad.hs b/compiler/GHC/HsToCore/Monad.hs index f570330480..a2163209c3 100644 --- a/compiler/GHC/HsToCore/Monad.hs +++ b/compiler/GHC/HsToCore/Monad.hs @@ -55,7 +55,7 @@ module GHC.HsToCore.Monad ( pprRuntimeTrace ) where -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad import GHC.Core.FamInstEnv @@ -68,7 +68,7 @@ import GHC.Tc.Utils.TcMType ( checkForLevPolyX, formatLevPolyErr ) import GHC.Builtin.Names import GHC.Types.Name.Reader import GHC.Driver.Types -import Bag +import GHC.Data.Bag import GHC.Types.Basic ( Origin ) import GHC.Core.DataCon import GHC.Core.ConLike @@ -76,15 +76,15 @@ import GHC.Core.TyCon import GHC.HsToCore.PmCheck.Types import GHC.Types.Id import GHC.Types.Module -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Core.Type import GHC.Types.Unique.Supply import GHC.Types.Name import GHC.Types.Name.Env import GHC.Driver.Session -import ErrUtils -import FastString +import GHC.Utils.Error +import GHC.Data.FastString import GHC.Types.Unique.FM ( lookupWithDefaultUFM ) import GHC.Types.Literal ( mkLitString ) import GHC.Types.CostCentre.State diff --git a/compiler/GHC/HsToCore/PmCheck.hs b/compiler/GHC/HsToCore/PmCheck.hs index 6c8ac7f046..8b34f275b0 100644 --- a/compiler/GHC/HsToCore/PmCheck.hs +++ b/compiler/GHC/HsToCore/PmCheck.hs @@ -22,14 +22,14 @@ module GHC.HsToCore.PmCheck ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.HsToCore.PmCheck.Types import GHC.HsToCore.PmCheck.Oracle import GHC.HsToCore.PmCheck.Ppr import GHC.Types.Basic (Origin, isGenerated) import GHC.Core (CoreExpr, Expr(Var,App)) -import FastString (unpackFS, lengthFS) +import GHC.Data.FastString (unpackFS, lengthFS) import GHC.Driver.Session import GHC.Hs import GHC.Tc.Utils.Zonk (shortCutLit) @@ -39,8 +39,8 @@ import GHC.Types.Name import GHC.Tc.Instance.Family import GHC.Builtin.Types import GHC.Types.SrcLoc -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Core.DataCon import GHC.Core.TyCon import GHC.Types.Var (EvVar) @@ -52,14 +52,14 @@ import {-# SOURCE #-} GHC.HsToCore.Binds (dsHsWrapper) import GHC.HsToCore.Utils (selectMatchVar) import GHC.HsToCore.Match.Literal (dsLit, dsOverLit) import GHC.HsToCore.Monad -import Bag -import OrdList +import GHC.Data.Bag +import GHC.Data.OrdList import GHC.Core.TyCo.Rep import GHC.Core.Type import GHC.HsToCore.Utils (isTrueLHsExpr) -import Maybes +import GHC.Data.Maybe import qualified GHC.LanguageExtensions as LangExt -import MonadUtils (concatMapM) +import GHC.Utils.Monad (concatMapM) import Control.Monad (when, forM_, zipWithM) import Data.List (elemIndex) diff --git a/compiler/GHC/HsToCore/PmCheck/Oracle.hs b/compiler/GHC/HsToCore/PmCheck/Oracle.hs index 63cc4710dd..4fd6132784 100644 --- a/compiler/GHC/HsToCore/PmCheck/Oracle.hs +++ b/compiler/GHC/HsToCore/PmCheck/Oracle.hs @@ -25,15 +25,15 @@ module GHC.HsToCore.PmCheck.Oracle ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.HsToCore.PmCheck.Types import GHC.Driver.Session -import Outputable -import ErrUtils -import Util -import Bag +import GHC.Utils.Outputable +import GHC.Utils.Error +import GHC.Utils.Misc +import GHC.Data.Bag import GHC.Types.Unique.Set import GHC.Types.Unique.DSet import GHC.Types.Unique @@ -49,9 +49,9 @@ import GHC.Core.SimpleOpt (simpleOptExpr, exprIsConApp_maybe) import GHC.Core.Utils (exprType) import GHC.Core.Make (mkListExpr, mkCharExpr) import GHC.Types.Unique.Supply -import FastString +import GHC.Data.FastString import GHC.Types.SrcLoc -import Maybes +import GHC.Data.Maybe import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.PatSyn @@ -64,7 +64,7 @@ import GHC.Tc.Solver (tcNormalise, tcCheckSatisfiability) import GHC.Core.Unify (tcMatchTy) import GHC.Tc.Types (completeMatchConLikes) import GHC.Core.Coercion -import MonadUtils hiding (foldlM) +import GHC.Utils.Monad hiding (foldlM) import GHC.HsToCore.Monad hiding (foldlM) import GHC.Tc.Instance.Family import GHC.Core.FamInstEnv diff --git a/compiler/GHC/HsToCore/PmCheck/Ppr.hs b/compiler/GHC/HsToCore/PmCheck/Ppr.hs index 30a5a92f2b..f8619f9a1d 100644 --- a/compiler/GHC/HsToCore/PmCheck/Ppr.hs +++ b/compiler/GHC/HsToCore/PmCheck/Ppr.hs @@ -10,7 +10,7 @@ module GHC.HsToCore.PmCheck.Ppr ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic import GHC.Types.Id @@ -19,10 +19,10 @@ import GHC.Types.Unique.DFM import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Builtin.Types -import Outputable +import GHC.Utils.Outputable import Control.Monad.Trans.RWS.CPS -import Util -import Maybes +import GHC.Utils.Misc +import GHC.Data.Maybe import Data.List.NonEmpty (NonEmpty, nonEmpty, toList) import GHC.HsToCore.PmCheck.Types diff --git a/compiler/GHC/HsToCore/PmCheck/Types.hs b/compiler/GHC/HsToCore/PmCheck/Types.hs index 60ed0ce356..310786b01c 100644 --- a/compiler/GHC/HsToCore/PmCheck/Types.hs +++ b/compiler/GHC/HsToCore/PmCheck/Types.hs @@ -39,11 +39,11 @@ module GHC.HsToCore.PmCheck.Types ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Util -import Bag -import FastString +import GHC.Utils.Misc +import GHC.Data.Bag +import GHC.Data.FastString import GHC.Types.Var (EvVar) import GHC.Types.Id import GHC.Types.Var.Env @@ -52,9 +52,9 @@ import GHC.Types.Unique.DFM import GHC.Types.Name import GHC.Core.DataCon import GHC.Core.ConLike -import Outputable -import ListSetOps (unionLists) -import Maybes +import GHC.Utils.Outputable +import GHC.Data.List.SetOps (unionLists) +import GHC.Data.Maybe import GHC.Core.Type import GHC.Core.TyCon import GHC.Types.Literal diff --git a/compiler/GHC/HsToCore/PmCheck/Types.hs-boot b/compiler/GHC/HsToCore/PmCheck/Types.hs-boot index abbaa33cfa..a7c472faa6 100644 --- a/compiler/GHC/HsToCore/PmCheck/Types.hs-boot +++ b/compiler/GHC/HsToCore/PmCheck/Types.hs-boot @@ -1,6 +1,6 @@ module GHC.HsToCore.PmCheck.Types where -import Bag +import GHC.Data.Bag data Delta diff --git a/compiler/GHC/HsToCore/Quote.hs b/compiler/GHC/HsToCore/Quote.hs index b49bd9d66b..54de211b3d 100644 --- a/compiler/GHC/HsToCore/Quote.hs +++ b/compiler/GHC/HsToCore/Quote.hs @@ -26,7 +26,7 @@ module GHC.HsToCore.Quote( dsBracket ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import {-# SOURCE #-} GHC.HsToCore.Expr ( dsExpr ) @@ -53,14 +53,14 @@ import GHC.Core.Utils import GHC.Types.SrcLoc as SrcLoc import GHC.Types.Unique import GHC.Types.Basic -import Outputable -import Bag +import GHC.Utils.Outputable +import GHC.Data.Bag import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import Util -import Maybes -import MonadUtils +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Utils.Monad import GHC.Tc.Types.Evidence import Control.Monad.Trans.Reader import Control.Monad.Trans.Class diff --git a/compiler/GHC/HsToCore/Usage.hs b/compiler/GHC/HsToCore/Usage.hs index b0588a0a01..c15fc022f0 100644 --- a/compiler/GHC/HsToCore/Usage.hs +++ b/compiler/GHC/HsToCore/Usage.hs @@ -11,7 +11,7 @@ module GHC.HsToCore.Usage ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Driver.Ways @@ -20,12 +20,12 @@ import GHC.Tc.Types import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Module -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Unique.Set import GHC.Types.Unique.FM -import Fingerprint -import Maybes +import GHC.Utils.Fingerprint +import GHC.Data.Maybe import GHC.Driver.Packages import GHC.Driver.Finder diff --git a/compiler/GHC/HsToCore/Utils.hs b/compiler/GHC/HsToCore/Utils.hs index 01f2a5c776..20ba64bbc5 100644 --- a/compiler/GHC/HsToCore/Utils.hs +++ b/compiler/GHC/HsToCore/Utils.hs @@ -46,7 +46,7 @@ module GHC.HsToCore.Utils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.HsToCore.Match ( matchSimply ) import {-# SOURCE #-} GHC.HsToCore.Expr ( dsLExpr ) @@ -76,11 +76,11 @@ import GHC.Types.Unique.Supply import GHC.Types.Module import GHC.Builtin.Names import GHC.Types.Name( isInternalName ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc import GHC.Driver.Session -import FastString +import GHC.Data.FastString import qualified GHC.LanguageExtensions as LangExt import GHC.Tc.Types.Evidence diff --git a/compiler/GHC/Iface/Binary.hs b/compiler/GHC/Iface/Binary.hs index 2e1953ade7..3e00e8694d 100644 --- a/compiler/GHC/Iface/Binary.hs +++ b/compiler/GHC/Iface/Binary.hs @@ -33,7 +33,7 @@ module GHC.Iface.Binary ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad import GHC.Builtin.Utils ( isKnownKeyName, lookupKnownKeyName ) @@ -44,18 +44,18 @@ import GHC.Types.Name import GHC.Driver.Session import GHC.Types.Unique.FM import GHC.Types.Unique.Supply -import Panic -import Binary +import GHC.Utils.Panic +import GHC.Utils.Binary as Binary import GHC.Types.SrcLoc -import ErrUtils -import FastMutInt +import GHC.Utils.Error +import GHC.Data.FastMutInt import GHC.Types.Unique -import Outputable +import GHC.Utils.Outputable import GHC.Types.Name.Cache import GHC.Platform -import FastString +import GHC.Data.FastString import GHC.Settings.Constants -import Util +import GHC.Utils.Misc import Data.Array import Data.Array.ST diff --git a/compiler/GHC/Iface/Env.hs b/compiler/GHC/Iface/Env.hs index 72cff8b8d7..75b93605be 100644 --- a/compiler/GHC/Iface/Env.hs +++ b/compiler/GHC/Iface/Env.hs @@ -22,7 +22,7 @@ module GHC.Iface.Env ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad import GHC.Driver.Types @@ -31,14 +31,14 @@ import GHC.Types.Var import GHC.Types.Name import GHC.Types.Avail import GHC.Types.Module -import FastString -import FastStringEnv +import GHC.Data.FastString +import GHC.Data.FastString.Env import GHC.Iface.Type import GHC.Types.Name.Cache import GHC.Types.Unique.Supply import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import Data.List ( partition ) {- diff --git a/compiler/GHC/Iface/Ext/Ast.hs b/compiler/GHC/Iface/Ext/Ast.hs index 15edfd7bb6..f35cf8f2f0 100644 --- a/compiler/GHC/Iface/Ext/Ast.hs +++ b/compiler/GHC/Iface/Ext/Ast.hs @@ -17,12 +17,12 @@ Main functions for .hie file generation module GHC.Iface.Ext.Ast ( mkHieFile, mkHieFileWithSource, getCompressedAsts) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Avail ( Avails ) -import Bag ( Bag, bagToList ) +import GHC.Data.Bag ( Bag, bagToList ) import GHC.Types.Basic -import BooleanFormula +import GHC.Data.BooleanFormula import GHC.Core.Class ( FunDep ) import GHC.Core.Utils ( exprType ) import GHC.Core.ConLike ( conLikeName ) @@ -31,7 +31,7 @@ import GHC.Types.FieldLabel import GHC.Hs import GHC.Driver.Types import GHC.Types.Module ( ModuleName, ml_hs_file ) -import MonadUtils ( concatMapM, liftIO ) +import GHC.Utils.Monad ( concatMapM, liftIO ) import GHC.Types.Name ( Name, nameSrcSpan, setNameLoc ) import GHC.Types.Name.Env ( NameEnv, emptyNameEnv, extendNameEnv, lookupNameEnv ) import GHC.Types.SrcLoc @@ -41,8 +41,8 @@ import GHC.Builtin.Types ( mkListTy, mkSumTy ) import GHC.Types.Var ( Id, Var, setVarName, varName, varType ) import GHC.Tc.Types import GHC.Iface.Make ( mkIfaceExports ) -import Panic -import Maybes +import GHC.Utils.Panic +import GHC.Data.Maybe import GHC.Iface.Ext.Types import GHC.Iface.Ext.Utils diff --git a/compiler/GHC/Iface/Ext/Binary.hs b/compiler/GHC/Iface/Ext/Binary.hs index a90234c60f..0077c23ee4 100644 --- a/compiler/GHC/Iface/Ext/Binary.hs +++ b/compiler/GHC/Iface/Ext/Binary.hs @@ -18,21 +18,21 @@ where import GHC.Settings.Utils ( maybeRead ) import Config ( cProjectVersion ) -import GhcPrelude -import Binary +import GHC.Prelude +import GHC.Utils.Binary import GHC.Iface.Binary ( getDictFastString ) -import FastMutInt -import FastString ( FastString ) +import GHC.Data.FastMutInt +import GHC.Data.FastString ( FastString ) import GHC.Types.Module ( Module ) import GHC.Types.Name import GHC.Types.Name.Cache -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Utils import GHC.Types.SrcLoc as SrcLoc import GHC.Types.Unique.Supply ( takeUniqFromSupply ) import GHC.Types.Unique import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import qualified Data.Array as A import Data.IORef diff --git a/compiler/GHC/Iface/Ext/Debug.hs b/compiler/GHC/Iface/Ext/Debug.hs index 292668fe23..bb0c827627 100644 --- a/compiler/GHC/Iface/Ext/Debug.hs +++ b/compiler/GHC/Iface/Ext/Debug.hs @@ -7,12 +7,12 @@ Functions to validate and check .hie file ASTs generated by GHC. module GHC.Iface.Ext.Debug where -import GhcPrelude +import GHC.Prelude import GHC.Types.SrcLoc import GHC.Types.Module -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Iface.Ext.Types import GHC.Iface.Ext.Binary diff --git a/compiler/GHC/Iface/Ext/Types.hs b/compiler/GHC/Iface/Ext/Types.hs index edd6540e80..88cb9c2042 100644 --- a/compiler/GHC/Iface/Ext/Types.hs +++ b/compiler/GHC/Iface/Ext/Types.hs @@ -12,18 +12,18 @@ For more information see https://gitlab.haskell.org/ghc/ghc/wikis/hie-files {-# LANGUAGE OverloadedStrings #-} module GHC.Iface.Ext.Types where -import GhcPrelude +import GHC.Prelude import Config -import Binary -import FastString ( FastString ) +import GHC.Utils.Binary +import GHC.Data.FastString ( FastString ) import GHC.Iface.Type import GHC.Types.Module ( ModuleName, Module ) import GHC.Types.Name ( Name ) -import Outputable hiding ( (<>) ) +import GHC.Utils.Outputable hiding ( (<>) ) import GHC.Types.SrcLoc ( RealSrcSpan ) import GHC.Types.Avail -import qualified Outputable as O ( (<>) ) +import qualified GHC.Utils.Outputable as O ( (<>) ) import qualified Data.Array as A import qualified Data.Map as M diff --git a/compiler/GHC/Iface/Ext/Utils.hs b/compiler/GHC/Iface/Ext/Utils.hs index bbbe1084f1..3b9bb2b4aa 100644 --- a/compiler/GHC/Iface/Ext/Utils.hs +++ b/compiler/GHC/Iface/Ext/Utils.hs @@ -4,14 +4,14 @@ {-# LANGUAGE FlexibleInstances #-} module GHC.Iface.Ext.Utils where -import GhcPrelude +import GHC.Prelude import GHC.Core.Map -import GHC.Driver.Session ( DynFlags ) -import FastString ( FastString, mkFastString ) +import GHC.Driver.Session ( DynFlags ) +import GHC.Data.FastString ( FastString, mkFastString ) import GHC.Iface.Type import GHC.Types.Name hiding (varName) -import Outputable ( renderWithStyle, ppr, defaultUserStyle, initSDocContext ) +import GHC.Utils.Outputable ( renderWithStyle, ppr, defaultUserStyle, initSDocContext ) import GHC.Types.SrcLoc import GHC.CoreToIface import GHC.Core.TyCon diff --git a/compiler/GHC/Iface/Load.hs b/compiler/GHC/Iface/Load.hs index 5fca78c67c..0068441ee3 100644 --- a/compiler/GHC/Iface/Load.hs +++ b/compiler/GHC/Iface/Load.hs @@ -34,7 +34,7 @@ module GHC.Iface.Load ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.IfaceToCore ( tcIfaceDecl, tcIfaceRules, tcIfaceInst, tcIfaceFamInst @@ -48,7 +48,7 @@ import GHC.Driver.Types import GHC.Types.Basic hiding (SuccessFlag(..)) import GHC.Tc.Utils.Monad -import Binary ( BinData(..) ) +import GHC.Utils.Binary ( BinData(..) ) import GHC.Settings.Constants import GHC.Builtin.Names import GHC.Builtin.Utils @@ -64,17 +64,17 @@ import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.Avail import GHC.Types.Module -import Maybes -import ErrUtils +import GHC.Data.Maybe +import GHC.Utils.Error import GHC.Driver.Finder import GHC.Types.Unique.FM import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Iface.Binary -import Panic -import Util -import FastString -import Fingerprint +import GHC.Utils.Panic +import GHC.Utils.Misc +import GHC.Data.FastString +import GHC.Utils.Fingerprint import GHC.Driver.Hooks import GHC.Types.FieldLabel import GHC.Iface.Rename diff --git a/compiler/GHC/Iface/Load.hs-boot b/compiler/GHC/Iface/Load.hs-boot index 51270ccb33..7e7d235bb7 100644 --- a/compiler/GHC/Iface/Load.hs-boot +++ b/compiler/GHC/Iface/Load.hs-boot @@ -3,6 +3,6 @@ module GHC.Iface.Load where import GHC.Types.Module (Module) import GHC.Tc.Utils.Monad (IfM) import GHC.Driver.Types (ModIface) -import Outputable (SDoc) +import GHC.Utils.Outputable (SDoc) loadSysInterface :: SDoc -> Module -> IfM lcl ModIface diff --git a/compiler/GHC/Iface/Make.hs b/compiler/GHC/Iface/Make.hs index ef9e77b44d..6ffce05405 100644 --- a/compiler/GHC/Iface/Make.hs +++ b/compiler/GHC/Iface/Make.hs @@ -21,7 +21,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Syntax import GHC.Iface.Recomp @@ -53,12 +53,12 @@ import GHC.Types.Name.Reader import GHC.Types.Name.Env import GHC.Types.Name.Set import GHC.Types.Module -import ErrUtils -import Outputable -import GHC.Types.Basic hiding ( SuccessFlag(..) ) -import Util hiding ( eqListBy ) -import FastString -import Maybes +import GHC.Utils.Error +import GHC.Utils.Outputable +import GHC.Types.Basic hiding ( SuccessFlag(..) ) +import GHC.Utils.Misc hiding ( eqListBy ) +import GHC.Data.FastString +import GHC.Data.Maybe import GHC.HsToCore.Docs import Data.Function diff --git a/compiler/GHC/Iface/Recomp.hs b/compiler/GHC/Iface/Recomp.hs index 57809a6d59..430f7b4207 100644 --- a/compiler/GHC/Iface/Recomp.hs +++ b/compiler/GHC/Iface/Recomp.hs @@ -12,7 +12,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Syntax import GHC.Iface.Recomp.Binary @@ -29,16 +29,16 @@ import GHC.Driver.Session import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Module -import ErrUtils -import Digraph +import GHC.Utils.Error +import GHC.Data.Graph.Directed import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Unique -import Util hiding ( eqListBy ) -import Maybes -import Binary -import Fingerprint -import Exception +import GHC.Utils.Misc hiding ( eqListBy ) +import GHC.Data.Maybe +import GHC.Utils.Binary +import GHC.Utils.Fingerprint +import GHC.Utils.Exception import GHC.Types.Unique.Set import GHC.Driver.Packages @@ -766,7 +766,7 @@ addFingerprints hsc_env iface0 -- used to construct the edges and -- stronglyConnCompFromEdgedVertices is deterministic -- even with non-deterministic order of edges as - -- explained in Note [Deterministic SCC] in Digraph. + -- explained in Note [Deterministic SCC] in GHC.Data.Graph.Directed. where getParent :: OccName -> OccName getParent occ = lookupOccEnv parent_map occ `orElse` occ diff --git a/compiler/GHC/Iface/Recomp/Binary.hs b/compiler/GHC/Iface/Recomp/Binary.hs index 55742b55eb..c07b5d7d16 100644 --- a/compiler/GHC/Iface/Recomp/Binary.hs +++ b/compiler/GHC/Iface/Recomp/Binary.hs @@ -10,13 +10,13 @@ module GHC.Iface.Recomp.Binary #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Fingerprint -import Binary +import GHC.Utils.Fingerprint +import GHC.Utils.Binary import GHC.Types.Name -import PlainPanic -import Util +import GHC.Utils.Panic.Plain +import GHC.Utils.Misc fingerprintBinMem :: BinHandle -> IO Fingerprint fingerprintBinMem bh = withBinBuffer bh f diff --git a/compiler/GHC/Iface/Recomp/Flags.hs b/compiler/GHC/Iface/Recomp/Flags.hs index ff5b23b709..66b6b9f15f 100644 --- a/compiler/GHC/Iface/Recomp/Flags.hs +++ b/compiler/GHC/Iface/Recomp/Flags.hs @@ -8,18 +8,18 @@ module GHC.Iface.Recomp.Flags ( , fingerprintHpcFlags ) where -import GhcPrelude +import GHC.Prelude -import Binary +import GHC.Utils.Binary import GHC.Driver.Session import GHC.Driver.Types import GHC.Types.Module import GHC.Types.Name -import Fingerprint +import GHC.Utils.Fingerprint import GHC.Iface.Recomp.Binary --- import Outputable +-- import GHC.Utils.Outputable -import qualified EnumSet +import GHC.Data.EnumSet as EnumSet import System.FilePath (normalise) -- | Produce a fingerprint of a @DynFlags@ value. We only base diff --git a/compiler/GHC/Iface/Rename.hs b/compiler/GHC/Iface/Rename.hs index 6bceb1effb..dbe847b5f4 100644 --- a/compiler/GHC/Iface/Rename.hs +++ b/compiler/GHC/Iface/Rename.hs @@ -17,10 +17,10 @@ module GHC.Iface.Rename ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Types import GHC.Types.Module import GHC.Types.Unique.FM @@ -28,12 +28,12 @@ import GHC.Types.Avail import GHC.Iface.Syntax import GHC.Types.FieldLabel import GHC.Types.Var -import ErrUtils +import GHC.Utils.Error import GHC.Types.Name import GHC.Tc.Utils.Monad -import Util -import Fingerprint +import GHC.Utils.Misc +import GHC.Utils.Fingerprint import GHC.Types.Basic -- a bit vexing @@ -42,7 +42,7 @@ import GHC.Driver.Session import qualified Data.Traversable as T -import Bag +import GHC.Data.Bag import Data.IORef import GHC.Types.Name.Shape import GHC.Iface.Env diff --git a/compiler/GHC/Iface/Syntax.hs b/compiler/GHC/Iface/Syntax.hs index 3c707bc348..9db82731d8 100644 --- a/compiler/GHC/Iface/Syntax.hs +++ b/compiler/GHC/Iface/Syntax.hs @@ -42,7 +42,7 @@ module GHC.Iface.Syntax ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Type import GHC.Iface.Recomp.Binary @@ -59,19 +59,19 @@ import GHC.Types.Literal import GHC.Types.ForeignCall import GHC.Types.Annotations( AnnPayload, AnnTarget ) import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Module import GHC.Types.SrcLoc -import Fingerprint -import Binary -import BooleanFormula ( BooleanFormula, pprBooleanFormula, isTrue ) +import GHC.Utils.Fingerprint +import GHC.Utils.Binary +import GHC.Data.BooleanFormula ( BooleanFormula, pprBooleanFormula, isTrue ) import GHC.Types.Var( VarBndr(..), binderVar ) import GHC.Core.TyCon ( Role (..), Injectivity(..), tyConBndrVisArgFlag ) -import Util( dropList, filterByList, notNull, unzipWith, debugIsOn ) +import GHC.Utils.Misc( dropList, filterByList, notNull, unzipWith, debugIsOn ) import GHC.Core.DataCon (SrcStrictness(..), SrcUnpackedness(..)) import GHC.Utils.Lexeme (isLexSym) import GHC.Builtin.Types ( constraintKindTyConName ) -import Util (seqList) +import GHC.Utils.Misc (seqList) import Control.Monad import System.IO.Unsafe diff --git a/compiler/GHC/Iface/Tidy.hs b/compiler/GHC/Iface/Tidy.hs index 3fc645e278..e3c3c0b01c 100644 --- a/compiler/GHC/Iface/Tidy.hs +++ b/compiler/GHC/Iface/Tidy.hs @@ -14,7 +14,7 @@ module GHC.Iface.Tidy ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Driver.Session @@ -30,7 +30,7 @@ import GHC.Core.Rules import GHC.Core.PatSyn import GHC.Core.ConLike import GHC.Core.Arity ( exprArity, exprBotStrictness_maybe ) -import StaticPtrTable +import GHC.Iface.Tidy.StaticPtrTable import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Types.Var @@ -54,11 +54,11 @@ import GHC.Core.TyCon import GHC.Core.Class import GHC.Types.Module import GHC.Driver.Types -import Maybes +import GHC.Data.Maybe import GHC.Types.Unique.Supply -import Outputable -import Util( filterOut ) -import qualified ErrUtils as Err +import GHC.Utils.Outputable +import GHC.Utils.Misc( filterOut ) +import qualified GHC.Utils.Error as Err import Control.Monad import Data.Function @@ -378,7 +378,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod ; (tidy_env, tidy_binds) <- tidyTopBinds hsc_env unfold_env tidy_occ_env trimmed_binds - -- See Note [Grand plan for static forms] in StaticPtrTable. + -- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. ; (spt_entries, tidy_binds') <- sptCreateStaticBinds hsc_env mod tidy_binds ; let { spt_init_code = sptModuleInitCode mod spt_entries diff --git a/compiler/main/StaticPtrTable.hs b/compiler/GHC/Iface/Tidy/StaticPtrTable.hs index 006b6f2b39..09125a4b53 100644 --- a/compiler/main/StaticPtrTable.hs +++ b/compiler/GHC/Iface/Tidy/StaticPtrTable.hs @@ -46,7 +46,7 @@ -- {-# LANGUAGE ViewPatterns, TupleSections #-} -module StaticPtrTable +module GHC.Iface.Tidy.StaticPtrTable ( sptCreateStaticBinds , sptModuleInitCode ) where @@ -122,7 +122,7 @@ Here is a running example: in upsweep after we have compiled the module (see GHC.Driver.Make.upsweep'). -} -import GhcPrelude +import GHC.Prelude import GHC.Cmm.CLabel import GHC.Core @@ -134,7 +134,7 @@ import GHC.Types.Id import GHC.Core.Make (mkStringExprFSWith) import GHC.Types.Module import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Platform import GHC.Builtin.Names import GHC.Tc.Utils.Env (lookupGlobal) diff --git a/compiler/GHC/Iface/Type.hs b/compiler/GHC/Iface/Type.hs index 6aedf0fd4c..5c2172f96f 100644 --- a/compiler/GHC/Iface/Type.hs +++ b/compiler/GHC/Iface/Type.hs @@ -60,7 +60,7 @@ module GHC.Iface.Type ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Builtin.Types ( coercibleTyCon, heqTyCon @@ -73,11 +73,11 @@ import GHC.Types.Var import GHC.Builtin.Names import GHC.Types.Name import GHC.Types.Basic -import Binary -import Outputable -import FastString -import FastStringEnv -import Util +import GHC.Utils.Binary +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.FastString.Env +import GHC.Utils.Misc import Data.Maybe( isJust ) import qualified Data.Semigroup as Semi diff --git a/compiler/main/UpdateCafInfos.hs b/compiler/GHC/Iface/UpdateCafInfos.hs index c8a0e725e3..befb95c6ef 100644 --- a/compiler/main/UpdateCafInfos.hs +++ b/compiler/GHC/Iface/UpdateCafInfos.hs @@ -1,10 +1,10 @@ {-# LANGUAGE CPP, BangPatterns, Strict, RecordWildCards #-} -module UpdateCafInfos +module GHC.Iface.UpdateCafInfos ( updateModDetailsCafInfos ) where -import GhcPrelude +import GHC.Prelude import GHC.Core import GHC.Driver.Session @@ -14,9 +14,9 @@ import GHC.Types.Id.Info import GHC.Core.InstEnv import GHC.Types.Name.Env import GHC.Types.Name.Set -import Util +import GHC.Utils.Misc import GHC.Types.Var -import Outputable +import GHC.Utils.Outputable #include "HsVersions.h" @@ -116,7 +116,7 @@ updateGlobalIds env e = go env e case lookupNameEnv env (varName var) of Nothing -> var Just (AnId id) -> id - Just other -> pprPanic "UpdateCafInfos.updateGlobalIds" $ + Just other -> pprPanic "GHC.Iface.UpdateCafInfos.updateGlobalIds" $ text "Found a non-Id for Id Name" <+> ppr (varName var) $$ nest 4 (text "Id:" <+> ppr var $$ text "TyThing:" <+> ppr other) diff --git a/compiler/GHC/IfaceToCore.hs b/compiler/GHC/IfaceToCore.hs index 5f3cd10cfb..d895b9228e 100644 --- a/compiler/GHC/IfaceToCore.hs +++ b/compiler/GHC/IfaceToCore.hs @@ -24,7 +24,7 @@ module GHC.IfaceToCore ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Types.Literals(typeNatCoAxiomRules) import GHC.Iface.Syntax @@ -66,16 +66,16 @@ import GHC.Core.Opt.OccurAnal ( occurAnalyseExpr ) import GHC.Types.Module import GHC.Types.Unique.FM import GHC.Types.Unique.Supply -import Outputable -import Maybes +import GHC.Utils.Outputable +import GHC.Data.Maybe import GHC.Types.SrcLoc import GHC.Driver.Session -import Util -import FastString +import GHC.Utils.Misc +import GHC.Data.FastString import GHC.Types.Basic hiding ( SuccessFlag(..) ) -import ListSetOps +import GHC.Data.List.SetOps import GHC.Fingerprint -import qualified BooleanFormula as BF +import qualified GHC.Data.BooleanFormula as BF import Control.Monad import qualified Data.Map as Map diff --git a/compiler/GHC/IfaceToCore.hs-boot b/compiler/GHC/IfaceToCore.hs-boot index e658493d8f..91b538ef41 100644 --- a/compiler/GHC/IfaceToCore.hs-boot +++ b/compiler/GHC/IfaceToCore.hs-boot @@ -1,6 +1,6 @@ module GHC.IfaceToCore where -import GhcPrelude +import GHC.Prelude import GHC.Iface.Syntax ( IfaceDecl, IfaceClsInst, IfaceFamInst, IfaceRule , IfaceAnnotation, IfaceCompleteMatch ) import GHC.Core.TyCo.Rep ( TyThing ) diff --git a/compiler/GHC/Llvm/MetaData.hs b/compiler/GHC/Llvm/MetaData.hs index 3e319c7036..c2a1aa4a8f 100644 --- a/compiler/GHC/Llvm/MetaData.hs +++ b/compiler/GHC/Llvm/MetaData.hs @@ -2,10 +2,10 @@ module GHC.Llvm.MetaData where -import GhcPrelude +import GHC.Prelude import GHC.Llvm.Types -import Outputable +import GHC.Utils.Outputable -- The LLVM Metadata System. -- diff --git a/compiler/GHC/Llvm/Ppr.hs b/compiler/GHC/Llvm/Ppr.hs index 4645c89e1a..c16f6b4136 100644 --- a/compiler/GHC/Llvm/Ppr.hs +++ b/compiler/GHC/Llvm/Ppr.hs @@ -25,7 +25,7 @@ module GHC.Llvm.Ppr ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Llvm.Syntax import GHC.Llvm.MetaData @@ -33,9 +33,9 @@ import GHC.Llvm.Types import GHC.Platform import Data.List ( intersperse ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique -import FastString ( sLit ) +import GHC.Data.FastString ( sLit ) -------------------------------------------------------------------------------- -- * Top Level Print functions diff --git a/compiler/GHC/Llvm/Syntax.hs b/compiler/GHC/Llvm/Syntax.hs index 51324b396d..12e0073c7a 100644 --- a/compiler/GHC/Llvm/Syntax.hs +++ b/compiler/GHC/Llvm/Syntax.hs @@ -4,7 +4,7 @@ module GHC.Llvm.Syntax where -import GhcPrelude +import GHC.Prelude import GHC.Llvm.MetaData import GHC.Llvm.Types diff --git a/compiler/GHC/Llvm/Types.hs b/compiler/GHC/Llvm/Types.hs index 0452e6177c..5a59c5c8fb 100644 --- a/compiler/GHC/Llvm/Types.hs +++ b/compiler/GHC/Llvm/Types.hs @@ -9,7 +9,7 @@ module GHC.Llvm.Types where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import Data.Char import Data.Int @@ -17,8 +17,8 @@ import Numeric import GHC.Platform import GHC.Driver.Session -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.Unique -- from NCG diff --git a/compiler/GHC/Parser.y b/compiler/GHC/Parser.y index 90b23f7ca6..81b0607a49 100644 --- a/compiler/GHC/Parser.y +++ b/compiler/GHC/Parser.y @@ -54,16 +54,16 @@ import GHC.Driver.Phases ( HscSource(..) ) import GHC.Driver.Types ( IsBootInterface, WarningTxt(..) ) import GHC.Driver.Session import GHC.Driver.Backpack.Syntax -import UnitInfo +import GHC.Unit.Info -- compiler/utils -import OrdList -import BooleanFormula ( BooleanFormula(..), LBooleanFormula(..), mkTrue ) -import FastString -import Maybes ( isJust, orElse ) -import Outputable -import Util ( looksLikePackageName, fstOf3, sndOf3, thdOf3 ) -import GhcPrelude +import GHC.Data.OrdList +import GHC.Data.BooleanFormula ( BooleanFormula(..), LBooleanFormula(..), mkTrue ) +import GHC.Data.FastString +import GHC.Data.Maybe ( isJust, orElse ) +import GHC.Utils.Outputable +import GHC.Utils.Misc ( looksLikePackageName, fstOf3, sndOf3, thdOf3 ) +import GHC.Prelude -- compiler/basicTypes import GHC.Types.Name.Reader diff --git a/compiler/GHC/Parser/Annotation.hs b/compiler/GHC/Parser/Annotation.hs index dbd1f79e23..e05ac34b75 100644 --- a/compiler/GHC/Parser/Annotation.hs +++ b/compiler/GHC/Parser/Annotation.hs @@ -13,10 +13,10 @@ module GHC.Parser.Annotation ( LRdrName -- Exists for haddocks only ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Name.Reader -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import qualified Data.Map as Map import Data.Data diff --git a/compiler/GHC/Parser/CharClass.hs b/compiler/GHC/Parser/CharClass.hs index dc98d48f94..6d09de764c 100644 --- a/compiler/GHC/Parser/CharClass.hs +++ b/compiler/GHC/Parser/CharClass.hs @@ -16,12 +16,12 @@ module GHC.Parser.CharClass #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import Data.Bits ( Bits((.&.),(.|.)) ) import Data.Char ( ord, chr ) import Data.Word -import Panic +import GHC.Utils.Panic -- Bit masks diff --git a/compiler/GHC/Parser/Header.hs b/compiler/GHC/Parser/Header.hs index e2373827f4..12fd44dc4b 100644 --- a/compiler/GHC/Parser/Header.hs +++ b/compiler/GHC/Parser/Header.hs @@ -24,26 +24,26 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Driver.Types import GHC.Parser ( parseHeader ) import GHC.Parser.Lexer -import FastString +import GHC.Data.FastString import GHC.Hs import GHC.Types.Module import GHC.Builtin.Names -import StringBuffer +import GHC.Data.StringBuffer import GHC.Types.SrcLoc import GHC.Driver.Session -import ErrUtils -import Util -import Outputable -import Maybes -import Bag ( emptyBag, listToBag, unitBag ) -import MonadUtils -import Exception +import GHC.Utils.Error +import GHC.Utils.Misc +import GHC.Utils.Outputable as Outputable +import GHC.Data.Maybe +import GHC.Data.Bag ( emptyBag, listToBag, unitBag ) +import GHC.Utils.Monad +import GHC.Utils.Exception as Exception import GHC.Types.Basic import qualified GHC.LanguageExtensions as LangExt @@ -345,7 +345,7 @@ optionsErrorMsgs dflags unhandled_flags flags_lines _filename , L l f' <- flags_lines , f == f' ] mkMsg (L flagSpan flag) = - ErrUtils.mkPlainErrMsg dflags flagSpan $ + GHC.Utils.Error.mkPlainErrMsg dflags flagSpan $ text "unknown flag in {-# OPTIONS_GHC #-} pragma:" <+> text flag optionsParseError :: String -> DynFlags -> SrcSpan -> a -- #15053 diff --git a/compiler/GHC/Parser/Lexer.x b/compiler/GHC/Parser/Lexer.x index 17b6674c95..3a93214cb4 100644 --- a/compiler/GHC/Parser/Lexer.x +++ b/compiler/GHC/Parser/Lexer.x @@ -69,7 +69,7 @@ module GHC.Parser.Lexer ( commentToAnnotation ) where -import GhcPrelude +import GHC.Prelude -- base import Control.Monad @@ -79,8 +79,7 @@ import Data.List import Data.Maybe import Data.Word -import EnumSet (EnumSet) -import qualified EnumSet +import GHC.Data.EnumSet as EnumSet -- ghc-boot import qualified GHC.LanguageExtensions as LangExt @@ -93,15 +92,15 @@ import Data.Map (Map) import qualified Data.Map as Map -- compiler/utils -import Bag -import Outputable -import StringBuffer -import FastString +import GHC.Data.Bag +import GHC.Utils.Outputable +import GHC.Data.StringBuffer +import GHC.Data.FastString import GHC.Types.Unique.FM -import Util ( readRational, readHexRational ) +import GHC.Utils.Misc ( readRational, readHexRational ) -- compiler/main -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Session as DynFlags -- compiler/basicTypes diff --git a/compiler/GHC/Parser/PostProcess.hs b/compiler/GHC/Parser/PostProcess.hs index b135478584..5a1817a1f6 100644 --- a/compiler/GHC/Parser/PostProcess.hs +++ b/compiler/GHC/Parser/PostProcess.hs @@ -103,7 +103,7 @@ module GHC.Parser.PostProcess ( PatBuilder ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs -- Lots of it import GHC.Core.TyCon ( TyCon, isTupleTyCon, tyConSingleDataCon_maybe ) import GHC.Core.DataCon ( DataCon, dataConTyCon ) @@ -123,16 +123,16 @@ import GHC.Types.ForeignCall import GHC.Builtin.Names ( allNameStrings ) import GHC.Types.SrcLoc import GHC.Types.Unique ( hasKey ) -import OrdList ( OrdList, fromOL ) -import Bag ( emptyBag, consBag ) -import Outputable -import FastString -import Maybes -import Util +import GHC.Data.OrdList ( OrdList, fromOL ) +import GHC.Data.Bag ( emptyBag, consBag ) +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString +import GHC.Data.Maybe +import GHC.Utils.Misc import GHC.Parser.Annotation import Data.List import GHC.Driver.Session ( WarningFlag(..), DynFlags ) -import ErrUtils ( Messages ) +import GHC.Utils.Error ( Messages ) import Control.Monad import Text.ParserCombinators.ReadP as ReadP diff --git a/compiler/GHC/Parser/PostProcess/Haddock.hs b/compiler/GHC/Parser/PostProcess/Haddock.hs index a3d5e101d7..f232113c2e 100644 --- a/compiler/GHC/Parser/PostProcess/Haddock.hs +++ b/compiler/GHC/Parser/PostProcess/Haddock.hs @@ -2,7 +2,7 @@ module GHC.Parser.PostProcess.Haddock where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Types.SrcLoc diff --git a/compiler/GHC/Platform/ARM.hs b/compiler/GHC/Platform/ARM.hs index d0c7e5811a..d1e2d9d312 100644 --- a/compiler/GHC/Platform/ARM.hs +++ b/compiler/GHC/Platform/ARM.hs @@ -2,7 +2,7 @@ module GHC.Platform.ARM where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_arm 1 diff --git a/compiler/GHC/Platform/ARM64.hs b/compiler/GHC/Platform/ARM64.hs index ebd66b92c5..5bc1ec91e2 100644 --- a/compiler/GHC/Platform/ARM64.hs +++ b/compiler/GHC/Platform/ARM64.hs @@ -2,7 +2,7 @@ module GHC.Platform.ARM64 where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_aarch64 1 diff --git a/compiler/GHC/Platform/NoRegs.hs b/compiler/GHC/Platform/NoRegs.hs index e8abf44253..c00f4cb7ff 100644 --- a/compiler/GHC/Platform/NoRegs.hs +++ b/compiler/GHC/Platform/NoRegs.hs @@ -2,7 +2,7 @@ module GHC.Platform.NoRegs where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 1 #include "../../../includes/CodeGen.Platform.hs" diff --git a/compiler/GHC/Platform/PPC.hs b/compiler/GHC/Platform/PPC.hs index f405f95438..5b4f3bfb14 100644 --- a/compiler/GHC/Platform/PPC.hs +++ b/compiler/GHC/Platform/PPC.hs @@ -2,7 +2,7 @@ module GHC.Platform.PPC where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_powerpc 1 diff --git a/compiler/GHC/Platform/Reg.hs b/compiler/GHC/Platform/Reg.hs index 00cd254630..37fd039ef7 100644 --- a/compiler/GHC/Platform/Reg.hs +++ b/compiler/GHC/Platform/Reg.hs @@ -26,9 +26,9 @@ module GHC.Platform.Reg ( where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Platform.Reg.Class import Data.List (intersect) diff --git a/compiler/GHC/Platform/Reg/Class.hs b/compiler/GHC/Platform/Reg/Class.hs index 8aa81c2fe9..3b967c5c55 100644 --- a/compiler/GHC/Platform/Reg/Class.hs +++ b/compiler/GHC/Platform/Reg/Class.hs @@ -4,9 +4,9 @@ module GHC.Platform.Reg.Class where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Unique diff --git a/compiler/GHC/Platform/Regs.hs b/compiler/GHC/Platform/Regs.hs index d214b0d89f..1b72d07979 100644 --- a/compiler/GHC/Platform/Regs.hs +++ b/compiler/GHC/Platform/Regs.hs @@ -3,7 +3,7 @@ module GHC.Platform.Regs (callerSaves, activeStgRegs, haveRegBase, globalRegMaybe, freeReg) where -import GhcPrelude +import GHC.Prelude import GHC.Cmm.Expr import GHC.Platform diff --git a/compiler/GHC/Platform/S390X.hs b/compiler/GHC/Platform/S390X.hs index 8599bb67c0..709d2db101 100644 --- a/compiler/GHC/Platform/S390X.hs +++ b/compiler/GHC/Platform/S390X.hs @@ -2,7 +2,7 @@ module GHC.Platform.S390X where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_s390x 1 diff --git a/compiler/GHC/Platform/SPARC.hs b/compiler/GHC/Platform/SPARC.hs index b0cdb27f44..b1dad08837 100644 --- a/compiler/GHC/Platform/SPARC.hs +++ b/compiler/GHC/Platform/SPARC.hs @@ -2,7 +2,7 @@ module GHC.Platform.SPARC where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_sparc 1 diff --git a/compiler/GHC/Platform/X86.hs b/compiler/GHC/Platform/X86.hs index 1570ba9fa0..e065036f61 100644 --- a/compiler/GHC/Platform/X86.hs +++ b/compiler/GHC/Platform/X86.hs @@ -2,7 +2,7 @@ module GHC.Platform.X86 where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_i386 1 diff --git a/compiler/GHC/Platform/X86_64.hs b/compiler/GHC/Platform/X86_64.hs index d2d1b15c71..27c4232975 100644 --- a/compiler/GHC/Platform/X86_64.hs +++ b/compiler/GHC/Platform/X86_64.hs @@ -2,7 +2,7 @@ module GHC.Platform.X86_64 where -import GhcPrelude +import GHC.Prelude #define MACHREGS_NO_REGS 0 #define MACHREGS_x86_64 1 diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs index 8ba1c5fb2d..c51ac4c053 100644 --- a/compiler/GHC/Plugins.hs +++ b/compiler/GHC/Plugins.hs @@ -41,13 +41,13 @@ module GHC.Plugins , module GHC.Types.Unique , module GHC.Types.Unique.Set , module GHC.Types.Unique.FM - , module FiniteMap - , module Util + , module GHC.Data.FiniteMap + , module GHC.Utils.Misc , module GHC.Serialized , module GHC.Types.SrcLoc - , module Outputable + , module GHC.Utils.Outputable , module GHC.Types.Unique.Supply - , module FastString + , module GHC.Data.FastString , -- * Getting 'Name's thNameToGhcName ) @@ -103,21 +103,21 @@ import GHC.Types.Unique.Set import GHC.Types.Unique.FM -- Conflicts with UniqFM: --import LazyUniqFM -import FiniteMap +import GHC.Data.FiniteMap -- Common utilities -import Util +import GHC.Utils.Misc import GHC.Serialized import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique.Supply import GHC.Types.Unique ( Unique, Uniquable(..) ) -import FastString +import GHC.Data.FastString import Data.Maybe import GHC.Iface.Env ( lookupOrigIO ) -import GhcPrelude -import MonadUtils ( mapMaybeM ) +import GHC.Prelude +import GHC.Utils.Monad ( mapMaybeM ) import GHC.ThToHs ( thRdrNameGuesses ) import GHC.Tc.Utils.Env ( lookupGlobal ) diff --git a/compiler/utils/GhcPrelude.hs b/compiler/GHC/Prelude.hs index dd78f15573..95c2d4b190 100644 --- a/compiler/utils/GhcPrelude.hs +++ b/compiler/GHC/Prelude.hs @@ -8,9 +8,9 @@ -- Every module in GHC -- * Is compiled with -XNoImplicitPrelude --- * Explicitly imports GhcPrelude +-- * Explicitly imports GHC.Prelude -module GhcPrelude (module X) where +module GHC.Prelude (module X) where -- We export the 'Semigroup' class but w/o the (<>) operator to avoid -- clashing with the (Outputable.<>) operator which is heavily used diff --git a/compiler/GHC/Rename/Bind.hs b/compiler/GHC/Rename/Bind.hs index b8dbfd1e1c..5f624a3000 100644 --- a/compiler/GHC/Rename/Bind.hs +++ b/compiler/GHC/Rename/Bind.hs @@ -29,7 +29,7 @@ module GHC.Rename.Bind ( HsSigCtxt(..) ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Rename.Expr( rnLExpr, rnStmts ) @@ -51,15 +51,15 @@ import GHC.Types.Name.Env import GHC.Types.Name.Set import GHC.Types.Name.Reader ( RdrName, rdrNameOcc ) import GHC.Types.SrcLoc as SrcLoc -import ListSetOps ( findDupsEq ) -import GHC.Types.Basic ( RecFlag(..), TypeOrKind(..) ) -import Digraph ( SCC(..) ) -import Bag -import Util -import Outputable +import GHC.Data.List.SetOps ( findDupsEq ) +import GHC.Types.Basic ( RecFlag(..), TypeOrKind(..) ) +import GHC.Data.Graph.Directed ( SCC(..) ) +import GHC.Data.Bag +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Types.Unique.Set -import Maybes ( orElse ) -import OrdList +import GHC.Data.Maybe ( orElse ) +import GHC.Data.OrdList import qualified GHC.LanguageExtensions as LangExt import Control.Monad diff --git a/compiler/GHC/Rename/Doc.hs b/compiler/GHC/Rename/Doc.hs index bd9fd60b73..f053795073 100644 --- a/compiler/GHC/Rename/Doc.hs +++ b/compiler/GHC/Rename/Doc.hs @@ -2,7 +2,7 @@ module GHC.Rename.Doc ( rnHsDoc, rnLHsDoc, rnMbLHsDoc ) where -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Hs diff --git a/compiler/GHC/Rename/Env.hs b/compiler/GHC/Rename/Env.hs index 18d922d636..1c22cf781e 100644 --- a/compiler/GHC/Rename/Env.hs +++ b/compiler/GHC/Rename/Env.hs @@ -44,7 +44,7 @@ module GHC.Rename.Env ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Load ( loadInterfaceForName, loadSrcInterface_maybe ) import GHC.Iface.Env @@ -63,18 +63,18 @@ import GHC.Types.Module import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.TyCon -import ErrUtils ( MsgDoc ) +import GHC.Utils.Error ( MsgDoc ) import GHC.Builtin.Names( rOOT_MAIN ) import GHC.Types.Basic ( pprWarningTxtForMsg, TopLevelFlag(..), TupleSort(..) ) import GHC.Types.SrcLoc as SrcLoc -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Unique.Set ( uniqSetAny ) -import Util -import Maybes +import GHC.Utils.Misc +import GHC.Data.Maybe import GHC.Driver.Session -import FastString +import GHC.Data.FastString import Control.Monad -import ListSetOps ( minusList ) +import GHC.Data.List.SetOps ( minusList ) import qualified GHC.LanguageExtensions as LangExt import GHC.Rename.Unbound import GHC.Rename.Utils diff --git a/compiler/GHC/Rename/Expr.hs b/compiler/GHC/Rename/Expr.hs index 9c52087448..62afe116df 100644 --- a/compiler/GHC/Rename/Expr.hs +++ b/compiler/GHC/Rename/Expr.hs @@ -26,7 +26,7 @@ module GHC.Rename.Expr ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Rename.Bind ( rnLocalBindsAndThen, rnLocalValBindsLHS, rnLocalValBindsRHS , rnMatchGroup, rnGRHS, makeMiniFixityEnv) @@ -54,12 +54,12 @@ import GHC.Types.Name.Set import GHC.Types.Name.Reader import GHC.Types.Unique.Set import Data.List -import Util -import ListSetOps ( removeDups ) -import ErrUtils -import Outputable +import GHC.Utils.Misc +import GHC.Data.List.SetOps ( removeDups ) +import GHC.Utils.Error +import GHC.Utils.Outputable as Outputable import GHC.Types.SrcLoc -import FastString +import GHC.Data.FastString import Control.Monad import GHC.Builtin.Types ( nilDataConName ) import qualified GHC.LanguageExtensions as LangExt @@ -353,7 +353,7 @@ rnExpr (ArithSeq x _ seq) For the static form we check that it is not used in splices. We also collect the free variables of the term which come from -this module. See Note [Grand plan for static forms] in StaticPtrTable. +this module. See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. -} rnExpr e@(HsStatic _ expr) = do diff --git a/compiler/GHC/Rename/Expr.hs-boot b/compiler/GHC/Rename/Expr.hs-boot index 012b7731b3..cc52d45e82 100644 --- a/compiler/GHC/Rename/Expr.hs-boot +++ b/compiler/GHC/Rename/Expr.hs-boot @@ -4,7 +4,7 @@ import GHC.Hs import GHC.Types.Name.Set ( FreeVars ) import GHC.Tc.Types import GHC.Types.SrcLoc ( Located ) -import Outputable ( Outputable ) +import GHC.Utils.Outputable ( Outputable ) rnLExpr :: LHsExpr GhcPs -> RnM (LHsExpr GhcRn, FreeVars) diff --git a/compiler/GHC/Rename/Fixity.hs b/compiler/GHC/Rename/Fixity.hs index b86be35160..5920a1ee9a 100644 --- a/compiler/GHC/Rename/Fixity.hs +++ b/compiler/GHC/Rename/Fixity.hs @@ -16,7 +16,7 @@ module GHC.Rename.Fixity ) where -import GhcPrelude +import GHC.Prelude import GHC.Iface.Load import GHC.Hs @@ -29,8 +29,8 @@ import GHC.Types.Module import GHC.Types.Basic ( Fixity(..), FixityDirection(..), minPrecedence, defaultFixity, SourceText(..) ) import GHC.Types.SrcLoc -import Outputable -import Maybes +import GHC.Utils.Outputable +import GHC.Data.Maybe import Data.List import Data.Function ( on ) import GHC.Rename.Unbound diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs index 822f6f9cb9..99b928af3f 100644 --- a/compiler/GHC/Rename/HsType.hs +++ b/compiler/GHC/Rename/HsType.hs @@ -32,7 +32,7 @@ module GHC.Rename.HsType ( nubL, elemRdr ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Rename.Splice( rnSpliceType ) @@ -54,14 +54,14 @@ import GHC.Types.SrcLoc import GHC.Types.Name.Set import GHC.Types.FieldLabel -import Util -import ListSetOps ( deleteBys ) +import GHC.Utils.Misc +import GHC.Data.List.SetOps ( deleteBys ) import GHC.Types.Basic ( compareFixity, funTyFixity, negateFixity , Fixity(..), FixityDirection(..), LexicalFixity(..) , TypeOrKind(..) ) -import Outputable -import FastString -import Maybes +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Maybe import qualified GHC.LanguageExtensions as LangExt import Data.List ( nubBy, partition, (\\) ) diff --git a/compiler/GHC/Rename/Module.hs b/compiler/GHC/Rename/Module.hs index bc2c7d3d5d..88ad0fee94 100644 --- a/compiler/GHC/Rename/Module.hs +++ b/compiler/GHC/Rename/Module.hs @@ -19,7 +19,7 @@ module GHC.Rename.Module ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Rename.Expr( rnLExpr ) import {-# SOURCE #-} GHC.Rename.Splice ( rnSpliceDecl, rnTopSpliceDecls ) @@ -53,19 +53,19 @@ import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Name.Env import GHC.Types.Avail -import Outputable -import Bag +import GHC.Utils.Outputable +import GHC.Data.Bag import GHC.Types.Basic ( pprRuleName, TypeOrKind(..) ) -import FastString +import GHC.Data.FastString import GHC.Types.SrcLoc as SrcLoc import GHC.Driver.Session -import Util ( debugIsOn, filterOut, lengthExceeds, partitionWith ) +import GHC.Utils.Misc ( debugIsOn, filterOut, lengthExceeds, partitionWith ) import GHC.Driver.Types ( HscEnv, hsc_dflags ) -import ListSetOps ( findDupsEq, removeDups, equivClasses ) -import Digraph ( SCC, flattenSCC, flattenSCCs, Node(..) - , stronglyConnCompFromEdgedVerticesUniq ) +import GHC.Data.List.SetOps ( findDupsEq, removeDups, equivClasses ) +import GHC.Data.Graph.Directed ( SCC, flattenSCC, flattenSCCs, Node(..) + , stronglyConnCompFromEdgedVerticesUniq ) import GHC.Types.Unique.Set -import OrdList +import GHC.Data.OrdList import qualified GHC.LanguageExtensions as LangExt import Control.Monad @@ -1397,7 +1397,7 @@ depAnalTyClDecls rdr_env kisig_fv_env ds_w_fvs -- It's OK to use nonDetEltsUFM here as -- stronglyConnCompFromEdgedVertices is still deterministic -- even if the edges are in nondeterministic order as explained - -- in Note [Deterministic SCC] in Digraph. + -- in Note [Deterministic SCC] in GHC.Data.Graph.Directed. toParents :: GlobalRdrEnv -> NameSet -> NameSet toParents rdr_env ns diff --git a/compiler/GHC/Rename/Names.hs b/compiler/GHC/Rename/Names.hs index ed08087899..c0832b5e35 100644 --- a/compiler/GHC/Rename/Names.hs +++ b/compiler/GHC/Rename/Names.hs @@ -32,7 +32,7 @@ module GHC.Rename.Names ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core.TyCo.Ppr @@ -53,13 +53,13 @@ import GHC.Types.FieldLabel import GHC.Driver.Types import GHC.Types.Name.Reader import GHC.Parser.PostProcess ( setRdrNameSpace ) -import Outputable -import Maybes +import GHC.Utils.Outputable as Outputable +import GHC.Data.Maybe import GHC.Types.SrcLoc as SrcLoc import GHC.Types.Basic ( TopLevelFlag(..), StringLiteral(..) ) -import Util -import FastString -import FastStringEnv +import GHC.Utils.Misc +import GHC.Data.FastString +import GHC.Data.FastString.Env import GHC.Types.Id import GHC.Core.Type import GHC.Core.PatSyn diff --git a/compiler/GHC/Rename/Pat.hs b/compiler/GHC/Rename/Pat.hs index 8e6747550e..1e2bf09f45 100644 --- a/compiler/GHC/Rename/Pat.hs +++ b/compiler/GHC/Rename/Pat.hs @@ -44,7 +44,7 @@ module GHC.Rename.Pat (-- main entry points -- ENH: thin imports to only what is necessary for patterns -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Rename.Expr ( rnLExpr ) import {-# SOURCE #-} GHC.Rename.Splice ( rnSplicePat ) @@ -67,9 +67,9 @@ import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Name.Reader import GHC.Types.Basic -import Util -import ListSetOps ( removeDups ) -import Outputable +import GHC.Utils.Misc +import GHC.Data.List.SetOps( removeDups ) +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Types.Literal ( inCharRange ) import GHC.Builtin.Types ( nilDataCon ) diff --git a/compiler/GHC/Rename/Splice.hs b/compiler/GHC/Rename/Splice.hs index c8aa73554f..1842cd0c44 100644 --- a/compiler/GHC/Rename/Splice.hs +++ b/compiler/GHC/Rename/Splice.hs @@ -14,7 +14,7 @@ module GHC.Rename.Splice ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Name import GHC.Types.Name.Set @@ -28,7 +28,7 @@ import GHC.Rename.Unbound ( isUnboundName ) import GHC.Rename.Module ( rnSrcDecls, findSplice ) import GHC.Rename.Pat ( rnPat ) import GHC.Types.Basic ( TopLevelFlag, isTopLevel, SourceText(..) ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module import GHC.Types.SrcLoc import GHC.Rename.HsType ( rnLHsType ) @@ -41,8 +41,8 @@ import GHC.Tc.Utils.Env ( checkWellStaged ) import GHC.Builtin.Names.TH ( liftName ) import GHC.Driver.Session -import FastString -import ErrUtils ( dumpIfSet_dyn_printer, DumpFormat (..) ) +import GHC.Data.FastString +import GHC.Utils.Error ( dumpIfSet_dyn_printer, DumpFormat (..) ) import GHC.Tc.Utils.Env ( tcMetaTy ) import GHC.Driver.Hooks import GHC.Builtin.Names.TH ( quoteExpName, quotePatName, quoteDecName, quoteTypeName diff --git a/compiler/GHC/Rename/Splice.hs-boot b/compiler/GHC/Rename/Splice.hs-boot index a885ea4387..06b8dc6c92 100644 --- a/compiler/GHC/Rename/Splice.hs-boot +++ b/compiler/GHC/Rename/Splice.hs-boot @@ -1,6 +1,6 @@ module GHC.Rename.Splice where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Utils.Monad import GHC.Types.Name.Set diff --git a/compiler/GHC/Rename/Unbound.hs b/compiler/GHC/Rename/Unbound.hs index aa4e05941f..c0cc6eeb64 100644 --- a/compiler/GHC/Rename/Unbound.hs +++ b/compiler/GHC/Rename/Unbound.hs @@ -17,7 +17,7 @@ module GHC.Rename.Unbound ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Name.Reader import GHC.Driver.Types @@ -25,12 +25,12 @@ import GHC.Tc.Utils.Monad import GHC.Types.Name import GHC.Types.Module import GHC.Types.SrcLoc as SrcLoc -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Builtin.Names ( mkUnboundName, isUnboundName, getUnique) -import Util -import Maybes +import GHC.Utils.Misc +import GHC.Data.Maybe import GHC.Driver.Session -import FastString +import GHC.Data.FastString import Data.List import Data.Function ( on ) import GHC.Types.Unique.DFM (udfmToList) diff --git a/compiler/GHC/Rename/Utils.hs b/compiler/GHC/Rename/Utils.hs index 3c4f5d065f..19a7c57cfb 100644 --- a/compiler/GHC/Rename/Utils.hs +++ b/compiler/GHC/Rename/Utils.hs @@ -33,7 +33,7 @@ module GHC.Rename.Utils ( where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Types.Name.Reader @@ -45,12 +45,12 @@ import GHC.Types.Name.Set import GHC.Types.Name.Env import GHC.Core.DataCon import GHC.Types.SrcLoc as SrcLoc -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Basic ( TopLevelFlag(..) ) -import ListSetOps ( removeDups ) +import GHC.Data.List.SetOps ( removeDups ) import GHC.Driver.Session -import FastString +import GHC.Data.FastString import Control.Monad import Data.List import GHC.Settings.Constants ( mAX_TUPLE_SIZE ) diff --git a/compiler/GHC/Runtime/Debugger.hs b/compiler/GHC/Runtime/Debugger.hs index 50622d8fa9..511293ba5c 100644 --- a/compiler/GHC/Runtime/Debugger.hs +++ b/compiler/GHC/Runtime/Debugger.hs @@ -14,7 +14,7 @@ module GHC.Runtime.Debugger (pprintClosureCommand, showTerm, pprTypeAndContents) where -import GhcPrelude +import GHC.Prelude import GHC.Runtime.Linker import GHC.Runtime.Heap.Inspect @@ -32,12 +32,12 @@ import GHC.Types.Var.Set import GHC.Types.Unique.Set import GHC.Core.Type import GHC -import Outputable +import GHC.Utils.Outputable import GHC.Core.Ppr.TyThing -import ErrUtils -import MonadUtils +import GHC.Utils.Error +import GHC.Utils.Monad import GHC.Driver.Session -import Exception +import GHC.Utils.Exception import Control.Monad import Data.List ( (\\) ) diff --git a/compiler/GHC/Runtime/Eval.hs b/compiler/GHC/Runtime/Eval.hs index 8e6d5e3ed5..cf3329fb8b 100644 --- a/compiler/GHC/Runtime/Eval.hs +++ b/compiler/GHC/Runtime/Eval.hs @@ -46,7 +46,7 @@ module GHC.Runtime.Eval ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Runtime.Eval.Types @@ -82,19 +82,19 @@ import GHC.Driver.Session import GHC.LanguageExtensions import GHC.Types.Unique import GHC.Types.Unique.Supply -import MonadUtils +import GHC.Utils.Monad import GHC.Types.Module import GHC.Builtin.Names ( toDynName, pretendNameIsInScope ) import GHC.Builtin.Types ( isCTupleTyConName ) -import Panic -import Maybes -import ErrUtils +import GHC.Utils.Panic +import GHC.Data.Maybe +import GHC.Utils.Error import GHC.Types.SrcLoc import GHC.Runtime.Heap.Inspect -import Outputable -import FastString -import Bag -import Util +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Bag +import GHC.Utils.Misc import qualified GHC.Parser.Lexer as Lexer (P (..), ParseResult(..), unP, mkPStatePure) import GHC.Parser.Lexer (ParserFlags) import qualified GHC.Parser as Parser (parseStmt, parseModule, parseDeclaration, parseImport) @@ -106,10 +106,10 @@ import qualified Data.IntMap as IntMap import Data.List (find,intercalate) import Data.Map (Map) import qualified Data.Map as Map -import StringBuffer (stringToStringBuffer) +import GHC.Data.StringBuffer (stringToStringBuffer) import Control.Monad import Data.Array -import Exception +import GHC.Utils.Exception import Unsafe.Coerce ( unsafeCoerce ) import GHC.Tc.Module ( runTcInteractive, tcRnType, loadUnqualIfaces ) diff --git a/compiler/GHC/Runtime/Eval/Types.hs b/compiler/GHC/Runtime/Eval/Types.hs index 753f776f20..0f2cd80c34 100644 --- a/compiler/GHC/Runtime/Eval/Types.hs +++ b/compiler/GHC/Runtime/Eval/Types.hs @@ -12,7 +12,7 @@ module GHC.Runtime.Eval.Types ( BreakInfo(..) ) where -import GhcPrelude +import GHC.Prelude import GHCi.RemoteTypes import GHCi.Message (EvalExpr, ResumeContext) @@ -22,7 +22,7 @@ import GHC.Types.Module import GHC.Types.Name.Reader import GHC.Core.Type import GHC.Types.SrcLoc -import Exception +import GHC.Utils.Exception import Data.Word import GHC.Stack.CCS diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index 0c856aa7a5..748020fa21 100644 --- a/compiler/GHC/Runtime/Heap/Inspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -25,7 +25,7 @@ module GHC.Runtime.Heap.Inspect( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Runtime.Interpreter as GHCi @@ -50,14 +50,14 @@ import GHC.Types.Name import GHC.Types.Name.Occurrence as OccName import GHC.Types.Module import GHC.Iface.Env -import Util +import GHC.Utils.Misc import GHC.Types.Var.Set import GHC.Types.Basic ( Boxity(..) ) import GHC.Builtin.Types.Prim import GHC.Builtin.Names import GHC.Builtin.Types import GHC.Driver.Session -import Outputable as Ppr +import GHC.Utils.Outputable as Ppr import GHC.Char import GHC.Exts.Heap import GHC.Runtime.Heap.Layout ( roundUpTo ) diff --git a/compiler/GHC/Runtime/Heap/Layout.hs b/compiler/GHC/Runtime/Heap/Layout.hs index c469f00cb4..7436cbefd8 100644 --- a/compiler/GHC/Runtime/Heap/Layout.hs +++ b/compiler/GHC/Runtime/Heap/Layout.hs @@ -44,13 +44,13 @@ module GHC.Runtime.Heap.Layout ( card, cardRoundUp, cardTableSizeB, cardTableSizeW ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic( ConTagZ ) import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable import GHC.Platform -import FastString +import GHC.Data.FastString import Data.Word import Data.Bits diff --git a/compiler/GHC/Runtime/Interpreter.hs b/compiler/GHC/Runtime/Interpreter.hs index 61e5297184..081c71d388 100644 --- a/compiler/GHC/Runtime/Interpreter.hs +++ b/compiler/GHC/Runtime/Interpreter.hs @@ -53,26 +53,26 @@ module GHC.Runtime.Interpreter , fromEvalResult ) where -import GhcPrelude +import GHC.Prelude import GHC.Runtime.Interpreter.Types import GHCi.Message import GHCi.RemoteTypes import GHCi.ResolvedBCO import GHCi.BreakArray (BreakArray) -import Fingerprint +import GHC.Utils.Fingerprint import GHC.Driver.Types import GHC.Types.Unique.FM -import Panic +import GHC.Utils.Panic import GHC.Driver.Session -import Exception +import GHC.Utils.Exception import GHC.Types.Basic -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Runtime.Eval.Types(BreakInfo(..)) -import Outputable(brackets, ppr, showSDocUnqual) +import GHC.Utils.Outputable(brackets, ppr, showSDocUnqual) import GHC.Types.SrcLoc -import Maybes +import GHC.Data.Maybe import GHC.Types.Module import GHC.ByteCode.Types import GHC.Types.Unique diff --git a/compiler/GHC/Runtime/Interpreter/Types.hs b/compiler/GHC/Runtime/Interpreter/Types.hs index 9decf8abb2..11f405815c 100644 --- a/compiler/GHC/Runtime/Interpreter/Types.hs +++ b/compiler/GHC/Runtime/Interpreter/Types.hs @@ -10,7 +10,7 @@ module GHC.Runtime.Interpreter.Types ) where -import GhcPrelude +import GHC.Prelude import GHCi.RemoteTypes import GHCi.Message ( Pipe ) diff --git a/compiler/GHC/Runtime/Linker.hs b/compiler/GHC/Runtime/Linker.hs index c103feb3fc..30be5eca55 100644 --- a/compiler/GHC/Runtime/Linker.hs +++ b/compiler/GHC/Runtime/Linker.hs @@ -29,7 +29,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Runtime.Interpreter import GHC.Runtime.Interpreter.Types @@ -47,18 +47,18 @@ import GHC.Driver.Ways import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.Module -import ListSetOps +import GHC.Data.List.SetOps import GHC.Runtime.Linker.Types (DynLinker(..), LinkerUnitId, PersistentLinkerState(..)) import GHC.Driver.Session import GHC.Types.Basic -import Outputable -import Panic -import Util -import ErrUtils +import GHC.Utils.Outputable +import GHC.Utils.Panic +import GHC.Utils.Misc +import GHC.Utils.Error import GHC.Types.SrcLoc -import qualified Maybes +import qualified GHC.Data.Maybe as Maybes import GHC.Types.Unique.DSet -import FastString +import GHC.Data.FastString import GHC.Platform import GHC.SysTools import GHC.SysTools.FileCleanup @@ -82,7 +82,7 @@ import System.Environment (lookupEnv) import System.Win32.Info (getSystemDirectory) #endif -import Exception +import GHC.Utils.Exception {- ********************************************************************** diff --git a/compiler/GHC/Runtime/Linker/Types.hs b/compiler/GHC/Runtime/Linker/Types.hs index d8530a1460..fce4e80e60 100644 --- a/compiler/GHC/Runtime/Linker/Types.hs +++ b/compiler/GHC/Runtime/Linker/Types.hs @@ -15,13 +15,13 @@ module GHC.Runtime.Linker.Types ( SptEntry(..) ) where -import GhcPrelude ( FilePath, String, show ) +import GHC.Prelude ( FilePath, String, show ) import Data.Time ( UTCTime ) import Data.Maybe ( Maybe ) import Control.Concurrent.MVar ( MVar ) import GHC.Types.Module ( InstalledUnitId, Module ) import GHC.ByteCode.Types ( ItblEnv, CompiledByteCode ) -import Outputable +import GHC.Utils.Outputable import GHC.Types.Var ( Id ) import GHC.Fingerprint.Type ( Fingerprint ) import GHC.Types.Name.Env ( NameEnv ) @@ -95,7 +95,7 @@ data Unlinked -- carries some static pointer table entries which -- should be loaded along with the BCOs. -- See Note [Grant plan for static forms] in - -- StaticPtrTable. + -- GHC.Iface.Tidy.StaticPtrTable. instance Outputable Unlinked where ppr (DotO path) = text "DotO" <+> text path @@ -104,7 +104,7 @@ instance Outputable Unlinked where ppr (BCOs bcos spt) = text "BCOs" <+> ppr bcos <+> ppr spt -- | An entry to be inserted into a module's static pointer table. --- See Note [Grand plan for static forms] in StaticPtrTable. +-- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable. data SptEntry = SptEntry Id Fingerprint instance Outputable SptEntry where diff --git a/compiler/GHC/Runtime/Loader.hs b/compiler/GHC/Runtime/Loader.hs index be8395896c..81168f7c28 100644 --- a/compiler/GHC/Runtime/Loader.hs +++ b/compiler/GHC/Runtime/Loader.hs @@ -20,7 +20,7 @@ module GHC.Runtime.Loader ( lessUnsafeCoerce ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Runtime.Linker ( linkModule, getHValue ) @@ -46,11 +46,11 @@ import GHC.Core.TyCon ( TyCon ) import GHC.Types.Name ( Name, nameModule_maybe ) import GHC.Types.Id ( idType ) import GHC.Types.Module ( Module, ModuleName ) -import Panic -import FastString -import ErrUtils -import Outputable -import Exception +import GHC.Utils.Panic +import GHC.Data.FastString +import GHC.Utils.Error +import GHC.Utils.Outputable +import GHC.Utils.Exception import GHC.Driver.Hooks import Control.Monad ( unless ) diff --git a/compiler/GHC/Settings.hs b/compiler/GHC/Settings.hs index e0466a1cf2..08b108a291 100644 --- a/compiler/GHC/Settings.hs +++ b/compiler/GHC/Settings.hs @@ -69,10 +69,10 @@ module GHC.Settings , sGhcRtsWithLibdw ) where -import GhcPrelude +import GHC.Prelude -import CliOption -import Fingerprint +import GHC.Utils.CliOption +import GHC.Utils.Fingerprint import GHC.Platform data Settings = Settings diff --git a/compiler/GHC/Settings/Constants.hs b/compiler/GHC/Settings/Constants.hs index 92a917e430..a852a5845d 100644 --- a/compiler/GHC/Settings/Constants.hs +++ b/compiler/GHC/Settings/Constants.hs @@ -1,7 +1,7 @@ -- | Compile-time settings module GHC.Settings.Constants where -import GhcPrelude +import GHC.Prelude import Config diff --git a/compiler/GHC/Settings/IO.hs b/compiler/GHC/Settings/IO.hs index bc15564543..225d5a6ec8 100644 --- a/compiler/GHC/Settings/IO.hs +++ b/compiler/GHC/Settings/IO.hs @@ -9,16 +9,16 @@ module GHC.Settings.IO #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Settings.Platform import GHC.Settings.Utils import Config -import CliOption -import Fingerprint +import GHC.Utils.CliOption +import GHC.Utils.Fingerprint import GHC.Platform -import Outputable +import GHC.Utils.Outputable import GHC.Settings import GHC.SysTools.BaseDir diff --git a/compiler/GHC/Stg/CSE.hs b/compiler/GHC/Stg/CSE.hs index 4fbcf47a02..404b7faffd 100644 --- a/compiler/GHC/Stg/CSE.hs +++ b/compiler/GHC/Stg/CSE.hs @@ -86,12 +86,12 @@ Solution: do unarise first. module GHC.Stg.CSE (stgCse) where -import GhcPrelude +import GHC.Prelude import GHC.Core.DataCon import GHC.Types.Id import GHC.Stg.Syntax -import Outputable +import GHC.Utils.Outputable import GHC.Types.Basic (isWeakLoopBreaker) import GHC.Types.Var.Env import GHC.Core (AltCon(..)) @@ -106,7 +106,7 @@ import Control.Monad( (>=>) ) -------------- -- A lookup trie for data constructor applications, i.e. --- keys of type `(DataCon, [StgArg])`, following the patterns in TrieMap. +-- keys of type `(DataCon, [StgArg])`, following the patterns in GHC.Data.TrieMap. data StgArgMap a = SAM { sam_var :: DVarEnv a diff --git a/compiler/GHC/Stg/DepAnal.hs b/compiler/GHC/Stg/DepAnal.hs index 90eec24f74..3f35acbb16 100644 --- a/compiler/GHC/Stg/DepAnal.hs +++ b/compiler/GHC/Stg/DepAnal.hs @@ -2,13 +2,13 @@ module GHC.Stg.DepAnal (depSortStgPgm) where -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Types.Id import GHC.Types.Name (Name, nameIsLocalOrFrom) import GHC.Types.Name.Env -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique.Set (nonDetEltsUniqSet) import GHC.Types.Var.Set import GHC.Types.Module (Module) diff --git a/compiler/GHC/Stg/FVs.hs b/compiler/GHC/Stg/FVs.hs index e323775c5f..7fd7a3cae6 100644 --- a/compiler/GHC/Stg/FVs.hs +++ b/compiler/GHC/Stg/FVs.hs @@ -42,14 +42,14 @@ module GHC.Stg.FVs ( annBindingFreeVars ) where -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Types.Id import GHC.Types.Var.Set import GHC.Core ( Tickish(Breakpoint) ) -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import Data.Maybe ( mapMaybe ) diff --git a/compiler/GHC/Stg/Lift.hs b/compiler/GHC/Stg/Lift.hs index f90ef519fe..8044584321 100644 --- a/compiler/GHC/Stg/Lift.hs +++ b/compiler/GHC/Stg/Lift.hs @@ -17,7 +17,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic import GHC.Driver.Session @@ -26,9 +26,9 @@ import GHC.Stg.FVs ( annBindingFreeVars ) import GHC.Stg.Lift.Analysis import GHC.Stg.Lift.Monad import GHC.Stg.Syntax -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique.Supply -import Util +import GHC.Utils.Misc import GHC.Types.Var.Set import Control.Monad ( when ) import Data.Maybe ( isNothing ) diff --git a/compiler/GHC/Stg/Lift/Analysis.hs b/compiler/GHC/Stg/Lift/Analysis.hs index 13778237ea..f6a955adb3 100644 --- a/compiler/GHC/Stg/Lift/Analysis.hs +++ b/compiler/GHC/Stg/Lift/Analysis.hs @@ -20,7 +20,7 @@ module GHC.Stg.Lift.Analysis ( closureGrowth -- Exported just for the docs ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Types.Basic @@ -32,8 +32,8 @@ import GHC.Stg.Syntax import qualified GHC.StgToCmm.ArgRep as StgToCmm.ArgRep import qualified GHC.StgToCmm.Closure as StgToCmm.Closure import qualified GHC.StgToCmm.Layout as StgToCmm.Layout -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Var.Set import Data.Maybe ( mapMaybe ) diff --git a/compiler/GHC/Stg/Lift/Monad.hs b/compiler/GHC/Stg/Lift/Monad.hs index 28ec3e1e69..b693730eca 100644 --- a/compiler/GHC/Stg/Lift/Monad.hs +++ b/compiler/GHC/Stg/Lift/Monad.hs @@ -22,21 +22,21 @@ module GHC.Stg.Lift.Monad ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic import GHC.Types.CostCentre ( isCurrentCCS, dontCareCCS ) import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.Id import GHC.Types.Name -import Outputable -import OrdList +import GHC.Utils.Outputable +import GHC.Data.OrdList import GHC.Stg.Subst import GHC.Stg.Syntax import GHC.Core.Type import GHC.Types.Unique.Supply -import Util +import GHC.Utils.Misc import GHC.Types.Var.Env import GHC.Types.Var.Set diff --git a/compiler/GHC/Stg/Lint.hs b/compiler/GHC/Stg/Lint.hs index bf4cfce443..69c961a081 100644 --- a/compiler/GHC/Stg/Lint.hs +++ b/compiler/GHC/Stg/Lint.hs @@ -37,12 +37,12 @@ basic properties listed above. module GHC.Stg.Lint ( lintStgTopBindings ) where -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Driver.Session -import Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList ) +import GHC.Data.Bag ( Bag, emptyBag, isEmptyBag, snocBag, bagToList ) import GHC.Types.Basic ( TopLevelFlag(..), isTopLevel ) import GHC.Types.CostCentre ( isCurrentCCS ) import GHC.Types.Id ( Id, idType, isJoinId, idName ) @@ -50,13 +50,13 @@ import GHC.Types.Var.Set import GHC.Core.DataCon import GHC.Core ( AltCon(..) ) import GHC.Types.Name ( getSrcLoc, nameIsLocalOrFrom ) -import ErrUtils ( MsgDoc, Severity(..), mkLocMessage ) +import GHC.Utils.Error ( MsgDoc, Severity(..), mkLocMessage ) import GHC.Core.Type import GHC.Types.RepType import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module ( Module ) -import qualified ErrUtils as Err +import qualified GHC.Utils.Error as Err import Control.Applicative ((<|>)) import Control.Monad diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs index 4b463cb95e..59b592fbc1 100644 --- a/compiler/GHC/Stg/Pipeline.hs +++ b/compiler/GHC/Stg/Pipeline.hs @@ -13,7 +13,7 @@ module GHC.Stg.Pipeline ( stg2stg ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax @@ -26,9 +26,9 @@ import GHC.Stg.Lift ( stgLiftLams ) import GHC.Types.Module ( Module ) import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error import GHC.Types.Unique.Supply -import Outputable +import GHC.Utils.Outputable import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.State.Strict diff --git a/compiler/GHC/Stg/Stats.hs b/compiler/GHC/Stg/Stats.hs index c2d546d587..329f319a47 100644 --- a/compiler/GHC/Stg/Stats.hs +++ b/compiler/GHC/Stg/Stats.hs @@ -27,12 +27,12 @@ module GHC.Stg.Stats ( showStgStats ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Types.Id (Id) -import Panic +import GHC.Utils.Panic import Data.Map (Map) import qualified Data.Map as Map diff --git a/compiler/GHC/Stg/Subst.hs b/compiler/GHC/Stg/Subst.hs index abbbfb0fd7..ba3550b330 100644 --- a/compiler/GHC/Stg/Subst.hs +++ b/compiler/GHC/Stg/Subst.hs @@ -4,13 +4,13 @@ module GHC.Stg.Subst where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Id import GHC.Types.Var.Env import Control.Monad.Trans.State.Strict -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc -- | A renaming substitution from 'Id's to 'Id's. Like 'RnEnv2', but not -- maintaining pairs of substitutions. Like 'GHC.Core.Subst.Subst', but diff --git a/compiler/GHC/Stg/Syntax.hs b/compiler/GHC/Stg/Syntax.hs index aefb49d988..71f1b5fbc1 100644 --- a/compiler/GHC/Stg/Syntax.hs +++ b/compiler/GHC/Stg/Syntax.hs @@ -61,7 +61,7 @@ module GHC.Stg.Syntax ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core ( AltCon, Tickish ) import GHC.Types.CostCentre ( CostCentreStack ) @@ -75,7 +75,7 @@ import GHC.Types.Id import GHC.Types.Var.Set import GHC.Types.Literal ( Literal, literalType ) import GHC.Types.Module ( Module ) -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Packages ( isDynLinkName ) import GHC.Platform import GHC.Core.Ppr( {- instances -} ) @@ -83,7 +83,7 @@ import GHC.Builtin.PrimOps ( PrimOp, PrimCall ) import GHC.Core.TyCon ( PrimRep(..), TyCon ) import GHC.Core.Type ( Type ) import GHC.Types.RepType ( typePrimRep1 ) -import Util +import GHC.Utils.Misc import Data.List.NonEmpty ( NonEmpty, toList ) diff --git a/compiler/GHC/Stg/Unarise.hs b/compiler/GHC/Stg/Unarise.hs index de74b0b0ab..e0b96d0249 100644 --- a/compiler/GHC/Stg/Unarise.hs +++ b/compiler/GHC/Stg/Unarise.hs @@ -200,25 +200,25 @@ module GHC.Stg.Unarise (unarise) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic import GHC.Core import GHC.Core.DataCon -import FastString (FastString, mkFastString) +import GHC.Data.FastString (FastString, mkFastString) import GHC.Types.Id import GHC.Types.Literal import GHC.Core.Make (aBSENT_SUM_FIELD_ERROR_ID) import GHC.Types.Id.Make (voidPrimId, voidArgId) -import MonadUtils (mapAccumLM) -import Outputable +import GHC.Utils.Monad (mapAccumLM) +import GHC.Utils.Outputable import GHC.Types.RepType import GHC.Stg.Syntax import GHC.Core.Type import GHC.Builtin.Types.Prim (intPrimTy,wordPrimTy,word64PrimTy) import GHC.Builtin.Types import GHC.Types.Unique.Supply -import Util +import GHC.Utils.Misc import GHC.Types.Var.Env import Data.Bifunctor (second) diff --git a/compiler/GHC/StgToCmm.hs b/compiler/GHC/StgToCmm.hs index 231144965e..4a2c379b36 100644 --- a/compiler/GHC/StgToCmm.hs +++ b/compiler/GHC/StgToCmm.hs @@ -13,7 +13,7 @@ module GHC.StgToCmm ( codeGen ) where #include "HsVersions.h" -import GhcPrelude as Prelude +import GHC.Prelude as Prelude import GHC.StgToCmm.Prof (initCostCentres, ldvEnter) import GHC.StgToCmm.Monad @@ -32,7 +32,7 @@ import GHC.Cmm.CLabel import GHC.Stg.Syntax import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Types import GHC.Types.CostCentre @@ -42,18 +42,18 @@ import GHC.Types.RepType import GHC.Core.DataCon import GHC.Core.TyCon import GHC.Types.Module -import Outputable -import Stream +import GHC.Utils.Outputable +import GHC.Data.Stream import GHC.Types.Basic import GHC.Types.Var.Set ( isEmptyDVarSet ) import GHC.SysTools.FileCleanup -import OrdList +import GHC.Data.OrdList import GHC.Cmm.Graph import Data.IORef import Control.Monad (when,void) -import Util +import GHC.Utils.Misc import System.IO.Unsafe import qualified Data.ByteString as BS diff --git a/compiler/GHC/StgToCmm/ArgRep.hs b/compiler/GHC/StgToCmm/ArgRep.hs index a3df5a881f..4d85d23d17 100644 --- a/compiler/GHC/StgToCmm/ArgRep.hs +++ b/compiler/GHC/StgToCmm/ArgRep.hs @@ -17,7 +17,7 @@ module GHC.StgToCmm.ArgRep ( ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.StgToCmm.Closure ( idPrimRep ) @@ -27,8 +27,8 @@ import GHC.Core.TyCon ( PrimRep(..), primElemRepSizeB ) import GHC.Types.Basic ( RepArity ) import GHC.Settings.Constants ( wORD64_SIZE, dOUBLE_SIZE ) -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString -- I extricated this code as this new module in order to avoid a -- cyclic dependency between GHC.StgToCmm.Layout and GHC.StgToCmm.Ticky. diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs index 8db97d8083..851da5ed21 100644 --- a/compiler/GHC/StgToCmm/Bind.hs +++ b/compiler/GHC/StgToCmm/Bind.hs @@ -13,7 +13,7 @@ module GHC.StgToCmm.Bind ( pushUpdateFrame, emitUpdateFrame ) where -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import GHC.Platform import GHC.StgToCmm.Expr @@ -43,12 +43,12 @@ import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Name import GHC.Types.Module -import ListSetOps -import Util +import GHC.Data.List.SetOps +import GHC.Utils.Misc import GHC.Types.Var.Set import GHC.Types.Basic -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Driver.Session import Control.Monad diff --git a/compiler/GHC/StgToCmm/CgUtils.hs b/compiler/GHC/StgToCmm/CgUtils.hs index 7775cdf033..1ed7f2384f 100644 --- a/compiler/GHC/StgToCmm/CgUtils.hs +++ b/compiler/GHC/StgToCmm/CgUtils.hs @@ -16,7 +16,7 @@ module GHC.StgToCmm.CgUtils ( get_GlobalReg_addr, ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform.Regs import GHC.Cmm @@ -25,7 +25,7 @@ import GHC.Cmm.Dataflow.Graph import GHC.Cmm.Utils import GHC.Cmm.CLabel import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable -- ----------------------------------------------------------------------------- -- Information about global registers diff --git a/compiler/GHC/StgToCmm/Closure.hs b/compiler/GHC/StgToCmm/Closure.hs index b7e7c48fa0..431a46ef48 100644 --- a/compiler/GHC/StgToCmm/Closure.hs +++ b/compiler/GHC/StgToCmm/Closure.hs @@ -64,7 +64,7 @@ module GHC.StgToCmm.Closure ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Runtime.Heap.Layout @@ -84,9 +84,9 @@ import GHC.Tc.Utils.TcType import GHC.Core.TyCon import GHC.Types.RepType import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session -import Util +import GHC.Utils.Misc import Data.Coerce (coerce) import qualified Data.ByteString.Char8 as BS8 diff --git a/compiler/GHC/StgToCmm/DataCon.hs b/compiler/GHC/StgToCmm/DataCon.hs index a0645305fa..6d2ca60944 100644 --- a/compiler/GHC/StgToCmm/DataCon.hs +++ b/compiler/GHC/StgToCmm/DataCon.hs @@ -17,7 +17,7 @@ module GHC.StgToCmm.DataCon ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Stg.Syntax import GHC.Core ( AltCon(..) ) @@ -38,17 +38,17 @@ import GHC.Types.CostCentre import GHC.Types.Module import GHC.Core.DataCon import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.Id import GHC.Types.Id.Info( CafInfo( NoCafRefs ) ) import GHC.Types.Name (isInternalName) import GHC.Types.RepType (countConRepArgs) import GHC.Types.Literal import GHC.Builtin.Utils -import Outputable +import GHC.Utils.Outputable import GHC.Platform -import Util -import MonadUtils (mapMaybeM) +import GHC.Utils.Misc +import GHC.Utils.Monad (mapMaybeM) import Control.Monad import Data.Char diff --git a/compiler/GHC/StgToCmm/Env.hs b/compiler/GHC/StgToCmm/Env.hs index da2158c7e9..03c53db979 100644 --- a/compiler/GHC/StgToCmm/Env.hs +++ b/compiler/GHC/StgToCmm/Env.hs @@ -24,7 +24,7 @@ module GHC.StgToCmm.Env ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCon import GHC.Platform @@ -41,12 +41,12 @@ import GHC.Driver.Session import GHC.Types.Id import GHC.Cmm.Graph import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Stg.Syntax import GHC.Core.Type import GHC.Builtin.Types.Prim import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import GHC.Types.Var.Env ------------------------------------- diff --git a/compiler/GHC/StgToCmm/Expr.hs b/compiler/GHC/StgToCmm/Expr.hs index 94cd97ca23..b05da01d1b 100644 --- a/compiler/GHC/StgToCmm/Expr.hs +++ b/compiler/GHC/StgToCmm/Expr.hs @@ -14,7 +14,7 @@ module GHC.StgToCmm.Expr ( cgExpr ) where #include "HsVersions.h" -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import {-# SOURCE #-} GHC.StgToCmm.Bind ( cgBind ) @@ -46,10 +46,10 @@ import GHC.Core.TyCon import GHC.Core.Type ( isUnliftedType ) import GHC.Types.RepType ( isVoidTy, countConRepArgs ) import GHC.Types.CostCentre ( CostCentreStack, currentCCS ) -import Maybes -import Util -import FastString -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Misc +import GHC.Data.FastString +import GHC.Utils.Outputable import Control.Monad ( unless, void ) import Control.Arrow ( first ) diff --git a/compiler/GHC/StgToCmm/ExtCode.hs b/compiler/GHC/StgToCmm/ExtCode.hs index 84195a67d2..e26d971c7f 100644 --- a/compiler/GHC/StgToCmm/ExtCode.hs +++ b/compiler/GHC/StgToCmm/ExtCode.hs @@ -37,7 +37,7 @@ module GHC.StgToCmm.ExtCode ( where -import GhcPrelude +import GHC.Prelude import qualified GHC.StgToCmm.Monad as F import GHC.StgToCmm.Monad (FCode, newUnique) @@ -48,7 +48,7 @@ import GHC.Cmm.Graph import GHC.Cmm.BlockId import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.Module import GHC.Types.Unique.FM import GHC.Types.Unique diff --git a/compiler/GHC/StgToCmm/Foreign.hs b/compiler/GHC/StgToCmm/Foreign.hs index 51fee717c4..72dae672ba 100644 --- a/compiler/GHC/StgToCmm/Foreign.hs +++ b/compiler/GHC/StgToCmm/Foreign.hs @@ -18,7 +18,7 @@ module GHC.StgToCmm.Foreign ( emitCloseNursery, ) where -import GhcPrelude hiding( succ, (<*>) ) +import GHC.Prelude hiding( succ, (<*>) ) import GHC.Stg.Syntax import GHC.StgToCmm.Prof (storeCurCCS, ccsType) @@ -39,14 +39,14 @@ import GHC.Runtime.Heap.Layout import GHC.Types.ForeignCall import GHC.Driver.Session import GHC.Platform -import Maybes -import Outputable +import GHC.Data.Maybe +import GHC.Utils.Outputable import GHC.Types.Unique.Supply import GHC.Types.Basic import GHC.Core.TyCo.Rep import GHC.Builtin.Types.Prim -import Util (zipEqual) +import GHC.Utils.Misc (zipEqual) import Control.Monad diff --git a/compiler/GHC/StgToCmm/Heap.hs b/compiler/GHC/StgToCmm/Heap.hs index 9a66d77c7f..65c2e7beff 100644 --- a/compiler/GHC/StgToCmm/Heap.hs +++ b/compiler/GHC/StgToCmm/Heap.hs @@ -22,7 +22,7 @@ module GHC.StgToCmm.Heap ( emitSetDynHdr ) where -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import GHC.Stg.Syntax import GHC.Cmm.CLabel @@ -47,8 +47,8 @@ import GHC.Types.Id ( Id ) import GHC.Types.Module import GHC.Driver.Session import GHC.Platform -import FastString( mkFastString, fsLit ) -import Panic( sorry ) +import GHC.Data.FastString( mkFastString, fsLit ) +import GHC.Utils.Panic( sorry ) import Control.Monad (when) import Data.Maybe (isJust) diff --git a/compiler/GHC/StgToCmm/Hpc.hs b/compiler/GHC/StgToCmm/Hpc.hs index 4feb81217b..e418d03fde 100644 --- a/compiler/GHC/StgToCmm/Hpc.hs +++ b/compiler/GHC/StgToCmm/Hpc.hs @@ -8,7 +8,7 @@ module GHC.StgToCmm.Hpc ( initHpc, mkTickBox ) where -import GhcPrelude +import GHC.Prelude import GHC.StgToCmm.Monad diff --git a/compiler/GHC/StgToCmm/Layout.hs b/compiler/GHC/StgToCmm/Layout.hs index 14ec8445c5..a02d66906f 100644 --- a/compiler/GHC/StgToCmm/Layout.hs +++ b/compiler/GHC/StgToCmm/Layout.hs @@ -32,7 +32,7 @@ module GHC.StgToCmm.Layout ( #include "HsVersions.h" -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import GHC.StgToCmm.Closure import GHC.StgToCmm.Env @@ -56,10 +56,10 @@ import GHC.Driver.Session import GHC.Platform import GHC.Types.Module -import Util +import GHC.Utils.Misc import Data.List -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import Control.Monad ------------------------------------------------------------------------ diff --git a/compiler/GHC/StgToCmm/Monad.hs b/compiler/GHC/StgToCmm/Monad.hs index a23d942c60..5516c2e7bc 100644 --- a/compiler/GHC/StgToCmm/Monad.hs +++ b/compiler/GHC/StgToCmm/Monad.hs @@ -59,7 +59,7 @@ module GHC.StgToCmm.Monad ( CgInfoDownwards(..), CgState(..) -- non-abstract ) where -import GhcPrelude hiding( sequence, succ ) +import GHC.Prelude hiding( sequence, succ ) import GHC.Platform import GHC.Cmm @@ -73,13 +73,13 @@ import GHC.Runtime.Heap.Layout import GHC.Types.Module import GHC.Types.Id import GHC.Types.Var.Env -import OrdList +import GHC.Data.OrdList import GHC.Types.Basic( ConTagZ ) import GHC.Types.Unique import GHC.Types.Unique.Supply -import FastString -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc import Control.Monad import Data.List diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs index b315c6a196..18acc11304 100644 --- a/compiler/GHC/StgToCmm/Prim.hs +++ b/compiler/GHC/StgToCmm/Prim.hs @@ -24,7 +24,7 @@ module GHC.StgToCmm.Prim ( #include "HsVersions.h" -import GhcPrelude hiding ((<*>)) +import GHC.Prelude hiding ((<*>)) import GHC.StgToCmm.Layout import GHC.StgToCmm.Foreign @@ -49,9 +49,9 @@ import GHC.Cmm.CLabel import GHC.Cmm.Utils import GHC.Builtin.PrimOps import GHC.Runtime.Heap.Layout -import FastString -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc import Data.Maybe import Data.Bits ((.&.), bit) diff --git a/compiler/GHC/StgToCmm/Prof.hs b/compiler/GHC/StgToCmm/Prof.hs index 578dbc1318..ae123fd9c7 100644 --- a/compiler/GHC/StgToCmm/Prof.hs +++ b/compiler/GHC/StgToCmm/Prof.hs @@ -23,7 +23,7 @@ module GHC.StgToCmm.Prof ( ldvEnter, ldvEnterClosure, ldvRecordCreate ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.StgToCmm.Closure @@ -38,9 +38,9 @@ import GHC.Cmm.CLabel import GHC.Types.CostCentre import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.Module as Module -import Outputable +import GHC.Utils.Outputable import Control.Monad import Data.Char (ord) diff --git a/compiler/GHC/StgToCmm/Ticky.hs b/compiler/GHC/StgToCmm/Ticky.hs index 179dc2d2d8..8eff2f608c 100644 --- a/compiler/GHC/StgToCmm/Ticky.hs +++ b/compiler/GHC/StgToCmm/Ticky.hs @@ -105,7 +105,7 @@ module GHC.StgToCmm.Ticky ( tickySlowCall, tickySlowCallPat, ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.StgToCmm.ArgRep ( slowCallPattern , toArgRep , argRepString ) @@ -124,9 +124,9 @@ import GHC.Types.Module import GHC.Types.Name import GHC.Types.Id import GHC.Types.Basic -import FastString -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Driver.Session diff --git a/compiler/GHC/StgToCmm/Utils.hs b/compiler/GHC/StgToCmm/Utils.hs index de59cf3be9..d60de74267 100644 --- a/compiler/GHC/StgToCmm/Utils.hs +++ b/compiler/GHC/StgToCmm/Utils.hs @@ -48,7 +48,7 @@ module GHC.StgToCmm.Utils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.StgToCmm.Monad @@ -69,13 +69,13 @@ import GHC.Core.TyCon import GHC.Runtime.Heap.Layout import GHC.Types.Module import GHC.Types.Literal -import Digraph -import Util +import GHC.Data.Graph.Directed +import GHC.Utils.Misc import GHC.Types.Unique import GHC.Types.Unique.Supply (MonadUnique(..)) import GHC.Driver.Session -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.RepType import GHC.Types.CostCentre diff --git a/compiler/GHC/SysTools.hs b/compiler/GHC/SysTools.hs index f3f1b4b1ca..0ec9912c8d 100644 --- a/compiler/GHC/SysTools.hs +++ b/compiler/GHC/SysTools.hs @@ -38,14 +38,14 @@ module GHC.SysTools ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Settings.Utils import GHC.Types.Module import GHC.Driver.Packages -import Outputable -import ErrUtils +import GHC.Utils.Outputable +import GHC.Utils.Error import GHC.Platform import GHC.Driver.Session import GHC.Driver.Ways diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs index 200b652049..198ad6596f 100644 --- a/compiler/GHC/SysTools/Ar.hs +++ b/compiler/GHC/SysTools/Ar.hs @@ -32,7 +32,7 @@ module GHC.SysTools.Ar ) where -import GhcPrelude +import GHC.Prelude import Data.List (mapAccumL, isPrefixOf) import Data.Monoid ((<>)) diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs index fe749b5cdc..e5b0c7ca61 100644 --- a/compiler/GHC/SysTools/BaseDir.hs +++ b/compiler/GHC/SysTools/BaseDir.hs @@ -19,12 +19,12 @@ module GHC.SysTools.BaseDir #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -- See note [Base Dir] for why some of this logic is shared with ghc-pkg. import GHC.BaseDir -import Panic +import GHC.Utils.Panic import System.Environment (lookupEnv) import System.FilePath diff --git a/compiler/GHC/SysTools/Elf.hs b/compiler/GHC/SysTools/Elf.hs index 5d4d87af45..ca563dfb52 100644 --- a/compiler/GHC/SysTools/Elf.hs +++ b/compiler/GHC/SysTools/Elf.hs @@ -14,16 +14,16 @@ module GHC.SysTools.Elf ( makeElfNote ) where -import GhcPrelude +import GHC.Prelude -import AsmUtils -import Exception +import GHC.Utils.Asm +import GHC.Utils.Exception import GHC.Driver.Session import GHC.Platform -import ErrUtils -import Maybes (MaybeT(..),runMaybeT) -import Util (charToC) -import Outputable (text,hcat,SDoc) +import GHC.Utils.Error +import GHC.Data.Maybe (MaybeT(..),runMaybeT) +import GHC.Utils.Misc (charToC) +import GHC.Utils.Outputable (text,hcat,SDoc) import Control.Monad (when) import Data.Binary.Get diff --git a/compiler/GHC/SysTools/ExtraObj.hs b/compiler/GHC/SysTools/ExtraObj.hs index f20f815107..0a04860185 100644 --- a/compiler/GHC/SysTools/ExtraObj.hs +++ b/compiler/GHC/SysTools/ExtraObj.hs @@ -13,17 +13,17 @@ module GHC.SysTools.ExtraObj ( haveRtsOptsFlags ) where -import AsmUtils -import ErrUtils +import GHC.Utils.Asm +import GHC.Utils.Error import GHC.Driver.Session import GHC.Driver.Packages import GHC.Platform -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.SrcLoc ( noSrcSpan ) import GHC.Types.Module import GHC.SysTools.Elf -import Util -import GhcPrelude +import GHC.Utils.Misc +import GHC.Prelude import Control.Monad import Data.Maybe diff --git a/compiler/GHC/SysTools/FileCleanup.hs b/compiler/GHC/SysTools/FileCleanup.hs index ef41185cdd..f72480d65f 100644 --- a/compiler/GHC/SysTools/FileCleanup.hs +++ b/compiler/GHC/SysTools/FileCleanup.hs @@ -7,13 +7,13 @@ module GHC.SysTools.FileCleanup , withSystemTempDirectory, withTempDirectory ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session -import ErrUtils -import Outputable -import Util -import Exception +import GHC.Utils.Error +import GHC.Utils.Outputable +import GHC.Utils.Misc +import GHC.Utils.Exception as Exception import GHC.Driver.Phases import Control.Monad diff --git a/compiler/GHC/SysTools/Info.hs b/compiler/GHC/SysTools/Info.hs index 8051570755..039c1d12aa 100644 --- a/compiler/GHC/SysTools/Info.hs +++ b/compiler/GHC/SysTools/Info.hs @@ -8,11 +8,11 @@ ----------------------------------------------------------------------------- module GHC.SysTools.Info where -import Exception -import ErrUtils +import GHC.Utils.Exception +import GHC.Utils.Error import GHC.Driver.Session -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import Data.List import Data.IORef @@ -20,7 +20,7 @@ import Data.IORef import System.IO import GHC.Platform -import GhcPrelude +import GHC.Prelude import GHC.SysTools.Process diff --git a/compiler/GHC/SysTools/Process.hs b/compiler/GHC/SysTools/Process.hs index 82f7a6d2f0..83547ab06c 100644 --- a/compiler/GHC/SysTools/Process.hs +++ b/compiler/GHC/SysTools/Process.hs @@ -10,14 +10,14 @@ module GHC.SysTools.Process where #include "HsVersions.h" -import Exception -import ErrUtils +import GHC.Utils.Exception +import GHC.Utils.Error import GHC.Driver.Session -import FastString -import Outputable -import Panic -import GhcPrelude -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Panic +import GHC.Prelude +import GHC.Utils.Misc import GHC.Types.SrcLoc ( SrcLoc, mkSrcLoc, noSrcSpan, mkSrcSpan ) import Control.Concurrent diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs index 9d7b736fee..ee2f664571 100644 --- a/compiler/GHC/SysTools/Tasks.hs +++ b/compiler/GHC/SysTools/Tasks.hs @@ -8,19 +8,19 @@ ----------------------------------------------------------------------------- module GHC.SysTools.Tasks where -import Exception -import ErrUtils +import GHC.Utils.Exception as Exception +import GHC.Utils.Error import GHC.Driver.Types import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable import GHC.Platform -import Util +import GHC.Utils.Misc import Data.List import System.IO import System.Process -import GhcPrelude +import GHC.Prelude import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersion, parseLlvmVersion) diff --git a/compiler/GHC/SysTools/Terminal.hs b/compiler/GHC/SysTools/Terminal.hs index 69c605bc73..c7951e0b43 100644 --- a/compiler/GHC/SysTools/Terminal.hs +++ b/compiler/GHC/SysTools/Terminal.hs @@ -2,7 +2,7 @@ {-# LANGUAGE ScopedTypeVariables #-} module GHC.SysTools.Terminal (stderrSupportsAnsiColors) where -import GhcPrelude +import GHC.Prelude #if defined(MIN_VERSION_terminfo) import Control.Exception (catch) diff --git a/compiler/GHC/Tc/Deriv.hs b/compiler/GHC/Tc/Deriv.hs index 6f5d72a51a..eca079ed23 100644 --- a/compiler/GHC/Tc/Deriv.hs +++ b/compiler/GHC/Tc/Deriv.hs @@ -15,7 +15,7 @@ module GHC.Tc.Deriv ( tcDeriving, DerivInfo(..) ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Driver.Session @@ -47,9 +47,9 @@ import GHC.Types.Avail import GHC.Core.Unify( tcUnifyTy ) import GHC.Core.Class import GHC.Core.Type -import ErrUtils +import GHC.Utils.Error import GHC.Core.DataCon -import Maybes +import GHC.Data.Maybe import GHC.Types.Name.Reader import GHC.Types.Name import GHC.Types.Name.Set as NameSet @@ -60,11 +60,11 @@ import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Builtin.Names import GHC.Types.SrcLoc -import Util -import Outputable -import FastString -import Bag -import FV (fvVarList, unionFV, mkFVs) +import GHC.Utils.Misc +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString +import GHC.Data.Bag +import GHC.Utils.FV as FV (fvVarList, unionFV, mkFVs) import qualified GHC.LanguageExtensions as LangExt import Control.Monad diff --git a/compiler/GHC/Tc/Deriv/Functor.hs b/compiler/GHC/Tc/Deriv/Functor.hs index 41aa86080d..6a13cfaccd 100644 --- a/compiler/GHC/Tc/Deriv/Functor.hs +++ b/compiler/GHC/Tc/Deriv/Functor.hs @@ -24,23 +24,23 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Bag +import GHC.Data.Bag import GHC.Core.DataCon -import FastString +import GHC.Data.FastString import GHC.Hs -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Names import GHC.Types.Name.Reader import GHC.Types.SrcLoc -import State +import GHC.Utils.Monad.State import GHC.Tc.Deriv.Generate import GHC.Tc.Utils.TcType import GHC.Core.TyCon import GHC.Core.TyCo.Rep import GHC.Core.Type -import Util +import GHC.Utils.Misc import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Id.Make (coerceId) diff --git a/compiler/GHC/Tc/Deriv/Generate.hs b/compiler/GHC/Tc/Deriv/Generate.hs index ad103ca7c8..8177416c4b 100644 --- a/compiler/GHC/Tc/Deriv/Generate.hs +++ b/compiler/GHC/Tc/Deriv/Generate.hs @@ -38,7 +38,7 @@ module GHC.Tc.Deriv.Generate ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad import GHC.Hs @@ -46,8 +46,8 @@ import GHC.Types.Name.Reader import GHC.Types.Basic import GHC.Core.DataCon import GHC.Types.Name -import Fingerprint -import Encoding +import GHC.Utils.Fingerprint +import GHC.Utils.Encoding import GHC.Driver.Session import GHC.Builtin.Utils @@ -69,13 +69,13 @@ import GHC.Core.Type import GHC.Core.Class import GHC.Types.Var.Set import GHC.Types.Var.Env -import Util +import GHC.Utils.Misc import GHC.Types.Var -import Outputable +import GHC.Utils.Outputable import GHC.Utils.Lexeme -import FastString -import Pair -import Bag +import GHC.Data.FastString +import GHC.Data.Pair +import GHC.Data.Bag import Data.List ( find, partition, intersperse ) @@ -2400,7 +2400,7 @@ mkAuxBinderName dflags parent occ_fun parent_stable_hash = let Fingerprint high low = fingerprintString parent_stable in toBase62 high ++ toBase62Padded low - -- See Note [Base 62 encoding 128-bit integers] in Encoding + -- See Note [Base 62 encoding 128-bit integers] in GHC.Utils.Encoding parent_occ = nameOccName parent diff --git a/compiler/GHC/Tc/Deriv/Generics.hs b/compiler/GHC/Tc/Deriv/Generics.hs index d4af39d83c..31dc85d7e9 100644 --- a/compiler/GHC/Tc/Deriv/Generics.hs +++ b/compiler/GHC/Tc/Deriv/Generics.hs @@ -19,7 +19,7 @@ module GHC.Tc.Deriv.Generics ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Core.Type @@ -42,14 +42,14 @@ import GHC.Builtin.Names import GHC.Tc.Utils.Env import GHC.Tc.Utils.Monad import GHC.Driver.Types -import ErrUtils( Validity(..), andValid ) +import GHC.Utils.Error( Validity(..), andValid ) import GHC.Types.SrcLoc -import Bag +import GHC.Data.Bag import GHC.Types.Var.Env import GHC.Types.Var.Set (elemVarSet) -import Outputable -import FastString -import Util +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Misc import Control.Monad (mplus) import Data.List (zip4, partition) diff --git a/compiler/GHC/Tc/Deriv/Infer.hs b/compiler/GHC/Tc/Deriv/Infer.hs index 849f0bf2a9..56dafd2097 100644 --- a/compiler/GHC/Tc/Deriv/Infer.hs +++ b/compiler/GHC/Tc/Deriv/Infer.hs @@ -16,16 +16,16 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Bag +import GHC.Data.Bag import GHC.Types.Basic import GHC.Core.Class import GHC.Core.DataCon -import ErrUtils +import GHC.Utils.Error import GHC.Tc.Utils.Instantiate -import Outputable -import Pair +import GHC.Utils.Outputable +import GHC.Data.Pair import GHC.Builtin.Names import GHC.Tc.Deriv.Utils import GHC.Tc.Utils.Env @@ -46,7 +46,7 @@ import GHC.Tc.Validity (validDerivPred) import GHC.Tc.Utils.Unify (buildImplicationFor, checkConstraints) import GHC.Builtin.Types (typeToTypeKind) import GHC.Core.Unify (tcUnifyTy) -import Util +import GHC.Utils.Misc import GHC.Types.Var import GHC.Types.Var.Set diff --git a/compiler/GHC/Tc/Deriv/Utils.hs b/compiler/GHC/Tc/Deriv/Utils.hs index 63c0e3002c..72ee0e6af3 100644 --- a/compiler/GHC/Tc/Deriv/Utils.hs +++ b/compiler/GHC/Tc/Deriv/Utils.hs @@ -22,14 +22,14 @@ module GHC.Tc.Deriv.Utils ( newDerivClsInst, extendLocalInstEnv ) where -import GhcPrelude +import GHC.Prelude -import Bag +import GHC.Data.Bag import GHC.Types.Basic import GHC.Core.Class import GHC.Core.DataCon import GHC.Driver.Session -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Types (lookupFixity, mi_fix) import GHC.Hs import GHC.Tc.Utils.Instantiate @@ -37,7 +37,7 @@ import GHC.Core.InstEnv import GHC.Iface.Load (loadInterfaceForName) import GHC.Types.Module (getModule) import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Names import GHC.Types.SrcLoc import GHC.Tc.Deriv.Generate @@ -50,13 +50,13 @@ import GHC.Builtin.Names.TH (liftClassKey) import GHC.Core.TyCon import GHC.Core.TyCo.Ppr (pprSourceTyCon) import GHC.Core.Type -import Util +import GHC.Utils.Misc import GHC.Types.Var.Set import Control.Monad.Trans.Reader import Data.Maybe import qualified GHC.LanguageExtensions as LangExt -import ListSetOps (assocMaybe) +import GHC.Data.List.SetOps (assocMaybe) -- | To avoid having to manually plumb everything in 'DerivEnv' throughout -- various functions in @GHC.Tc.Deriv@ and @GHC.Tc.Deriv.Infer@, we use 'DerivM', which diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index ae08f78443..e4746032d3 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -15,7 +15,7 @@ module GHC.Tc.Errors( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Tc.Utils.Monad @@ -51,19 +51,19 @@ import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Types.Name.Set -import Bag -import ErrUtils ( ErrMsg, errDoc, pprLocErrMsg ) +import GHC.Data.Bag +import GHC.Utils.Error ( ErrMsg, errDoc, pprLocErrMsg ) import GHC.Types.Basic import GHC.Core.ConLike ( ConLike(..)) -import Util -import FastString -import Outputable +import GHC.Utils.Misc +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Driver.Session -import ListSetOps ( equivClasses ) -import Maybes +import GHC.Data.List.SetOps ( equivClasses ) +import GHC.Data.Maybe import qualified GHC.LanguageExtensions as LangExt -import FV ( fvVarList, unionFV ) +import GHC.Utils.FV ( fvVarList, unionFV ) import Control.Monad ( when ) import Data.Foldable ( toList ) diff --git a/compiler/GHC/Tc/Errors/Hole.hs b/compiler/GHC/Tc/Errors/Hole.hs index 771765901c..543fa0fca0 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs +++ b/compiler/GHC/Tc/Errors/Hole.hs @@ -17,7 +17,7 @@ module GHC.Tc.Errors.Hole ) where -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Tc.Utils.Monad @@ -34,14 +34,14 @@ import GHC.Builtin.Names ( gHC_ERR ) import GHC.Types.Id import GHC.Types.Var.Set import GHC.Types.Var.Env -import Bag +import GHC.Data.Bag import GHC.Core.ConLike ( ConLike(..) ) -import Util +import GHC.Utils.Misc import GHC.Tc.Utils.Env (tcLookup) -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session -import Maybes -import FV ( fvVarList, fvVarSet, unionFV, mkFVs, FV ) +import GHC.Data.Maybe +import GHC.Utils.FV ( fvVarList, fvVarSet, unionFV, mkFVs, FV ) import Control.Arrow ( (&&&) ) diff --git a/compiler/GHC/Tc/Errors/Hole.hs-boot b/compiler/GHC/Tc/Errors/Hole.hs-boot index bc79c3eed4..fa3299c5d3 100644 --- a/compiler/GHC/Tc/Errors/Hole.hs-boot +++ b/compiler/GHC/Tc/Errors/Hole.hs-boot @@ -6,7 +6,7 @@ module GHC.Tc.Errors.Hole where import GHC.Tc.Types ( TcM ) import GHC.Tc.Types.Constraint ( Ct, Implication ) -import Outputable ( SDoc ) +import GHC.Utils.Outputable ( SDoc ) import GHC.Types.Var.Env ( TidyEnv ) findValidHoleFits :: TidyEnv -> [Implication] -> [Ct] -> Ct diff --git a/compiler/GHC/Tc/Errors/Hole/FitTypes.hs b/compiler/GHC/Tc/Errors/Hole/FitTypes.hs index 8aabc615ce..92bbe00115 100644 --- a/compiler/GHC/Tc/Errors/Hole/FitTypes.hs +++ b/compiler/GHC/Tc/Errors/Hole/FitTypes.hs @@ -5,7 +5,7 @@ module GHC.Tc.Errors.Hole.FitTypes ( hfIsLcl, pprHoleFitCand ) where -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Tc.Types.Constraint @@ -16,7 +16,7 @@ import GHC.Types.Name.Reader import GHC.Hs.Doc import GHC.Types.Id -import Outputable +import GHC.Utils.Outputable import GHC.Types.Name import Data.Function ( on ) diff --git a/compiler/GHC/Tc/Gen/Annotation.hs b/compiler/GHC/Tc/Gen/Annotation.hs index ef7168076f..47bca17766 100644 --- a/compiler/GHC/Tc/Gen/Annotation.hs +++ b/compiler/GHC/Tc/Gen/Annotation.hs @@ -10,7 +10,7 @@ -- | Typechecking annotations module GHC.Tc.Gen.Annotation ( tcAnnotations, annCtxt ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Splice ( runAnnotation ) import GHC.Types.Module @@ -22,7 +22,7 @@ import GHC.Types.Name import GHC.Types.Annotations import GHC.Tc.Utils.Monad import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Types -- Some platforms don't support the interpreter, and compilation on those diff --git a/compiler/GHC/Tc/Gen/Arrow.hs b/compiler/GHC/Tc/Gen/Arrow.hs index 69c5e67197..5d26927ed4 100644 --- a/compiler/GHC/Tc/Gen/Arrow.hs +++ b/compiler/GHC/Tc/Gen/Arrow.hs @@ -12,7 +12,7 @@ -- | Typecheck arrow notation module GHC.Tc.Gen.Arrow ( tcProc ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Expr( tcLExpr, tcInferRho, tcSyntaxOp, tcCheckId, tcCheckExpr ) @@ -35,8 +35,8 @@ import GHC.Types.Var.Set import GHC.Builtin.Types.Prim import GHC.Types.Basic( Arity ) import GHC.Types.SrcLoc -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import Control.Monad diff --git a/compiler/GHC/Tc/Gen/Bind.hs b/compiler/GHC/Tc/Gen/Bind.hs index 44fd594849..929e02cc07 100644 --- a/compiler/GHC/Tc/Gen/Bind.hs +++ b/compiler/GHC/Tc/Gen/Bind.hs @@ -20,7 +20,7 @@ module GHC.Tc.Gen.Bind ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Match ( tcGRHSsPat, tcMatchesFun ) import {-# SOURCE #-} GHC.Tc.Gen.Expr ( tcLExpr ) @@ -28,7 +28,7 @@ import {-# SOURCE #-} GHC.Tc.TyCl.PatSyn ( tcPatSynDecl, tcPatSynBuilderBind ) import GHC.Core (Tickish (..)) import GHC.Types.CostCentre (mkUserCC, CCFlavour(DeclCC)) import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Hs import GHC.Tc.Gen.Sig import GHC.Tc.Utils.Monad @@ -56,13 +56,13 @@ import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Name.Env import GHC.Types.SrcLoc -import Bag -import ErrUtils -import Digraph -import Maybes -import Util +import GHC.Data.Bag +import GHC.Utils.Error +import GHC.Data.Graph.Directed +import GHC.Data.Maybe +import GHC.Utils.Misc import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Builtin.Names( ipClassName ) import GHC.Tc.Validity (checkValidType) import GHC.Types.Unique.FM @@ -552,7 +552,7 @@ mkEdges sig_fn binds ] -- It's OK to use nonDetEltsUFM here as stronglyConnCompFromEdgedVertices -- is still deterministic even if the edges are in nondeterministic order - -- as explained in Note [Deterministic SCC] in Digraph. + -- as explained in Note [Deterministic SCC] in GHC.Data.Graph.Directed. where bind_fvs (FunBind { fun_ext = fvs }) = fvs bind_fvs (PatBind { pat_ext = fvs }) = fvs diff --git a/compiler/GHC/Tc/Gen/Default.hs b/compiler/GHC/Tc/Gen/Default.hs index bf1132aa3e..ab5e021653 100644 --- a/compiler/GHC/Tc/Gen/Default.hs +++ b/compiler/GHC/Tc/Gen/Default.hs @@ -8,7 +8,7 @@ -- | Typechecking @default@ declarations module GHC.Tc.Gen.Default ( tcDefaults ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Core.Class @@ -21,8 +21,8 @@ import GHC.Tc.Validity import GHC.Tc.Utils.TcType import GHC.Builtin.Names import GHC.Types.SrcLoc -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import qualified GHC.LanguageExtensions as LangExt tcDefaults :: [LDefaultDecl GhcRn] diff --git a/compiler/GHC/Tc/Gen/Export.hs b/compiler/GHC/Tc/Gen/Export.hs index b384b494e4..d4235ba171 100644 --- a/compiler/GHC/Tc/Gen/Export.hs +++ b/compiler/GHC/Tc/Gen/Export.hs @@ -7,7 +7,7 @@ module GHC.Tc.Gen.Export (tcRnExports, exports_from_avail) where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Builtin.Names @@ -18,7 +18,7 @@ import GHC.Tc.Utils.TcType import GHC.Rename.Names import GHC.Rename.Env import GHC.Rename.Unbound ( reportUnboundName ) -import ErrUtils +import GHC.Utils.Error import GHC.Types.Id import GHC.Types.Id.Info import GHC.Types.Module @@ -29,14 +29,14 @@ import GHC.Types.Avail import GHC.Core.TyCon import GHC.Types.SrcLoc as SrcLoc import GHC.Driver.Types -import Outputable +import GHC.Utils.Outputable import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.PatSyn -import Maybes +import GHC.Data.Maybe import GHC.Types.Unique.Set -import Util (capitalise) -import FastString (fsLit) +import GHC.Utils.Misc (capitalise) +import GHC.Data.FastString (fsLit) import Control.Monad import GHC.Driver.Session diff --git a/compiler/GHC/Tc/Gen/Expr.hs b/compiler/GHC/Tc/Gen/Expr.hs index 70201773b9..94341c62c2 100644 --- a/compiler/GHC/Tc/Gen/Expr.hs +++ b/compiler/GHC/Tc/Gen/Expr.hs @@ -30,7 +30,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Splice( tcSpliceExpr, tcTypedBracket, tcUntypedBracket ) import GHC.Builtin.Names.TH( liftStringName, liftName ) @@ -79,12 +79,12 @@ import GHC.Builtin.PrimOps( tagToEnumKey ) import GHC.Builtin.Names import GHC.Driver.Session import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc import GHC.Types.Var.Env ( emptyTidyEnv, mkInScopeSet ) -import ListSetOps -import Maybes -import Outputable -import FastString +import GHC.Data.List.SetOps +import GHC.Data.Maybe +import GHC.Utils.Outputable as Outputable +import GHC.Data.FastString import Control.Monad import GHC.Core.Class(classTyCon) import GHC.Types.Unique.Set ( nonDetEltsUniqSet ) @@ -578,7 +578,7 @@ tcExpr (HsProc x pat cmd) res_ty ; return $ mkHsWrapCo coi (HsProc x pat' cmd') } -- Typechecks the static form and wraps it with a call to 'fromStaticPtr'. --- See Note [Grand plan for static forms] in StaticPtrTable for an overview. +-- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable for an overview. -- To type check -- (static e) :: p a -- we want to check (e :: a), diff --git a/compiler/GHC/Tc/Gen/Foreign.hs b/compiler/GHC/Tc/Gen/Foreign.hs index 858d865026..8163e6820d 100644 --- a/compiler/GHC/Tc/Gen/Foreign.hs +++ b/compiler/GHC/Tc/Gen/Foreign.hs @@ -33,7 +33,7 @@ module GHC.Tc.Gen.Foreign #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs @@ -47,7 +47,7 @@ import GHC.Core.FamInstEnv import GHC.Core.Coercion import GHC.Core.Type import GHC.Types.ForeignCall -import ErrUtils +import GHC.Utils.Error import GHC.Types.Id import GHC.Types.Name import GHC.Types.Name.Reader @@ -56,10 +56,10 @@ import GHC.Core.TyCon import GHC.Tc.Utils.TcType import GHC.Builtin.Names import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Platform import GHC.Types.SrcLoc -import Bag +import GHC.Data.Bag import GHC.Driver.Hooks import qualified GHC.LanguageExtensions as LangExt diff --git a/compiler/GHC/Tc/Gen/HsType.hs b/compiler/GHC/Tc/Gen/HsType.hs index a25a7320e4..0614bfcc95 100644 --- a/compiler/GHC/Tc/Gen/HsType.hs +++ b/compiler/GHC/Tc/Gen/HsType.hs @@ -68,7 +68,7 @@ module GHC.Tc.Gen.HsType ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Utils.Monad @@ -103,18 +103,18 @@ import GHC.Builtin.Types import GHC.Types.Basic import GHC.Types.SrcLoc import GHC.Settings.Constants ( mAX_CTUPLE_SIZE ) -import ErrUtils( MsgDoc ) +import GHC.Utils.Error( MsgDoc ) import GHC.Types.Unique import GHC.Types.Unique.Set -import Util +import GHC.Utils.Misc import GHC.Types.Unique.Supply -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Builtin.Names hiding ( wildCardName ) import GHC.Driver.Session import qualified GHC.LanguageExtensions as LangExt -import Maybes +import GHC.Data.Maybe import Data.List ( find ) import Control.Monad diff --git a/compiler/GHC/Tc/Gen/Match.hs b/compiler/GHC/Tc/Gen/Match.hs index 45fece68c0..857470b155 100644 --- a/compiler/GHC/Tc/Gen/Match.hs +++ b/compiler/GHC/Tc/Gen/Match.hs @@ -34,7 +34,7 @@ module GHC.Tc.Gen.Match ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Expr( tcSyntaxOp, tcInferRhoNC, tcInferRho , tcCheckId, tcLExpr, tcLExprNC, tcExpr @@ -56,8 +56,8 @@ import GHC.Types.Id import GHC.Core.TyCon import GHC.Builtin.Types.Prim import GHC.Tc.Types.Evidence -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.SrcLoc -- Create chunkified tuple tybes for monad comprehensions diff --git a/compiler/GHC/Tc/Gen/Pat.hs b/compiler/GHC/Tc/Gen/Pat.hs index 0456677cc7..2f7d2e7721 100644 --- a/compiler/GHC/Tc/Gen/Pat.hs +++ b/compiler/GHC/Tc/Gen/Pat.hs @@ -26,7 +26,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Expr( tcSyntaxOp, tcSyntaxOpGen, tcInferSigma ) @@ -58,12 +58,12 @@ import GHC.Types.Basic hiding (SuccessFlag(..)) import GHC.Driver.Session import GHC.Types.SrcLoc import GHC.Types.Var.Set -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable as Outputable import qualified GHC.LanguageExtensions as LangExt import Control.Arrow ( second ) import Control.Monad ( when ) -import ListSetOps ( getNth ) +import GHC.Data.List.SetOps ( getNth ) {- ************************************************************************ diff --git a/compiler/GHC/Tc/Gen/Rule.hs b/compiler/GHC/Tc/Gen/Rule.hs index 35b20acaa8..20620d2c36 100644 --- a/compiler/GHC/Tc/Gen/Rule.hs +++ b/compiler/GHC/Tc/Gen/Rule.hs @@ -10,7 +10,7 @@ -- | Typechecking transformation rules module GHC.Tc.Gen.Rule ( tcRules ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Types @@ -33,9 +33,9 @@ import GHC.Types.Var( EvVar ) import GHC.Types.Var.Set import GHC.Types.Basic ( RuleName ) import GHC.Types.SrcLoc -import Outputable -import FastString -import Bag +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Bag {- Note [Typechecking rules] diff --git a/compiler/GHC/Tc/Gen/Sig.hs b/compiler/GHC/Tc/Gen/Sig.hs index 83fab20ca5..a8cdd08bce 100644 --- a/compiler/GHC/Tc/Gen/Sig.hs +++ b/compiler/GHC/Tc/Gen/Sig.hs @@ -25,7 +25,7 @@ module GHC.Tc.Gen.Sig( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Gen.HsType @@ -49,10 +49,10 @@ import GHC.Types.Basic import GHC.Types.Module( getModule ) import GHC.Types.Name import GHC.Types.Name.Env -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import Util( singleton ) -import Maybes( orElse ) +import GHC.Utils.Misc( singleton ) +import GHC.Data.Maybe( orElse ) import Data.Maybe( mapMaybe ) import Control.Monad( unless ) diff --git a/compiler/GHC/Tc/Gen/Splice.hs b/compiler/GHC/Tc/Gen/Splice.hs index 830e17abd4..67ef5a3e6c 100644 --- a/compiler/GHC/Tc/Gen/Splice.hs +++ b/compiler/GHC/Tc/Gen/Splice.hs @@ -34,7 +34,7 @@ module GHC.Tc.Gen.Splice( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Types.Annotations @@ -43,7 +43,7 @@ import GHC.Types.Name import GHC.Tc.Utils.Monad import GHC.Tc.Utils.TcType -import Outputable +import GHC.Utils.Outputable import GHC.Tc.Gen.Expr import GHC.Types.SrcLoc import GHC.Builtin.Names.TH @@ -103,21 +103,21 @@ import GHC.Types.Id.Info import GHC.HsToCore.Expr import GHC.HsToCore.Monad import GHC.Serialized -import ErrUtils -import Util +import GHC.Utils.Error +import GHC.Utils.Misc import GHC.Types.Unique import GHC.Types.Var.Set import Data.List ( find ) import Data.Maybe -import FastString +import GHC.Data.FastString import GHC.Types.Basic as BasicTypes hiding( SuccessFlag(..) ) -import Maybes( MaybeErr(..) ) +import GHC.Data.Maybe( MaybeErr(..) ) import GHC.Driver.Session -import Panic +import GHC.Utils.Panic as Panic import GHC.Utils.Lexeme -import qualified EnumSet +import qualified GHC.Data.EnumSet as EnumSet import GHC.Driver.Plugins -import Bag +import GHC.Data.Bag import qualified Language.Haskell.TH as TH -- THSyntax gives access to internal functions and data types diff --git a/compiler/GHC/Tc/Gen/Splice.hs-boot b/compiler/GHC/Tc/Gen/Splice.hs-boot index d74edf3f3a..fe57d4a124 100644 --- a/compiler/GHC/Tc/Gen/Splice.hs-boot +++ b/compiler/GHC/Tc/Gen/Splice.hs-boot @@ -3,7 +3,7 @@ module GHC.Tc.Gen.Splice where -import GhcPrelude +import GHC.Prelude import GHC.Types.Name import GHC.Hs.Expr ( PendingRnSplice, DelayedSplice ) import GHC.Tc.Types( TcM , SpliceType ) diff --git a/compiler/GHC/Tc/Instance/Class.hs b/compiler/GHC/Tc/Instance/Class.hs index 53054de7f8..43c2092c70 100644 --- a/compiler/GHC/Tc/Instance/Class.hs +++ b/compiler/GHC/Tc/Instance/Class.hs @@ -11,7 +11,7 @@ module GHC.Tc.Instance.Class ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Env import GHC.Tc.Utils.Monad @@ -40,8 +40,8 @@ import GHC.Core.DataCon import GHC.Core.TyCon import GHC.Core.Class import GHC.Driver.Session -import Outputable -import Util( splitAtList, fstOf3 ) +import GHC.Utils.Outputable +import GHC.Utils.Misc( splitAtList, fstOf3 ) import Data.Maybe {- ******************************************************************* diff --git a/compiler/GHC/Tc/Instance/Family.hs b/compiler/GHC/Tc/Instance/Family.hs index 68c894f2e4..6f1ac07f74 100644 --- a/compiler/GHC/Tc/Instance/Family.hs +++ b/compiler/GHC/Tc/Instance/Family.hs @@ -12,7 +12,7 @@ module GHC.Tc.Instance.Family ( reportInjectivityErrors, reportConflictingInjectivityErrs ) where -import GhcPrelude +import GHC.Prelude import GHC.Driver.Types import GHC.Core.FamInstEnv @@ -28,20 +28,20 @@ import GHC.Tc.Utils.TcType import GHC.Core.Coercion.Axiom import GHC.Driver.Session import GHC.Types.Module -import Outputable -import Util +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Name.Reader import GHC.Core.DataCon ( dataConName ) -import Maybes +import GHC.Data.Maybe import GHC.Core.TyCo.Rep import GHC.Core.TyCo.FVs import GHC.Core.TyCo.Ppr ( pprWithExplicitKindsWhen ) import GHC.Tc.Utils.TcMType import GHC.Types.Name -import Panic +import GHC.Utils.Panic import GHC.Types.Var.Set -import FV -import Bag( Bag, unionBags, unitBag ) +import GHC.Utils.FV +import GHC.Data.Bag( Bag, unionBags, unitBag ) import Control.Monad import Data.List ( sortBy ) import Data.List.NonEmpty ( NonEmpty(..) ) diff --git a/compiler/GHC/Tc/Instance/FunDeps.hs b/compiler/GHC/Tc/Instance/FunDeps.hs index 40344af9ed..aba9031be6 100644 --- a/compiler/GHC/Tc/Instance/FunDeps.hs +++ b/compiler/GHC/Tc/Instance/FunDeps.hs @@ -23,7 +23,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Name import GHC.Types.Var @@ -38,13 +38,13 @@ import GHC.Types.Var.Set import GHC.Types.Var.Env import GHC.Core.TyCo.FVs import GHC.Core.TyCo.Ppr( pprWithExplicitKindsWhen ) -import FV -import Outputable -import ErrUtils( Validity(..), allValid ) +import GHC.Utils.FV +import GHC.Utils.Outputable +import GHC.Utils.Error( Validity(..), allValid ) import GHC.Types.SrcLoc -import Util +import GHC.Utils.Misc -import Pair ( Pair(..) ) +import GHC.Data.Pair ( Pair(..) ) import Data.List ( nubBy ) import Data.Maybe import Data.Foldable ( fold ) diff --git a/compiler/GHC/Tc/Instance/Typeable.hs b/compiler/GHC/Tc/Instance/Typeable.hs index c3e59b2f4c..2c7656a20c 100644 --- a/compiler/GHC/Tc/Instance/Typeable.hs +++ b/compiler/GHC/Tc/Instance/Typeable.hs @@ -12,7 +12,7 @@ module GHC.Tc.Instance.Typeable(mkTypeableBinds, tyConIsTypeable) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Types.Basic ( Boxity(..), neverInlinePragma, SourceText(..) ) @@ -37,13 +37,13 @@ import GHC.Core.DataCon import GHC.Types.Module import GHC.Hs import GHC.Driver.Session -import Bag +import GHC.Data.Bag import GHC.Types.Var ( VarBndr(..) ) import GHC.Core.Map import GHC.Settings.Constants -import Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints) -import Outputable -import FastString ( FastString, mkFastString, fsLit ) +import GHC.Utils.Fingerprint(Fingerprint(..), fingerprintString, fingerprintFingerprints) +import GHC.Utils.Outputable +import GHC.Data.FastString ( FastString, mkFastString, fsLit ) import Control.Monad.Trans.State import Control.Monad.Trans.Class (lift) diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index cc3bf4a2cc..e202fdcec7 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -48,7 +48,7 @@ module GHC.Tc.Module ( getRenamedStuff, RenamedStuff ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Splice ( finishTH, runRemoteModFinalizers ) import GHC.Rename.Splice ( rnTopSpliceDecls, traceSplice, SpliceInfo(..) ) @@ -78,7 +78,7 @@ import GHC.Tc.Gen.Export import GHC.Tc.Types.Evidence import GHC.Tc.Types.Constraint import GHC.Tc.Types.Origin -import qualified BooleanFormula as BF +import qualified GHC.Data.BooleanFormula as BF import GHC.Core.Ppr.TyThing ( pprTyThingInContext ) import GHC.Core.FVs ( orphNamesOfFamInst ) import GHC.Tc.Instance.Family @@ -106,7 +106,7 @@ import GHC.Iface.Load import GHC.Rename.Names import GHC.Rename.Env import GHC.Rename.Module -import ErrUtils +import GHC.Utils.Error import GHC.Types.Id as Id import GHC.Types.Id.Info( IdDetails(..) ) import GHC.Types.Var.Env @@ -119,8 +119,8 @@ import GHC.Types.Avail import GHC.Core.TyCon import GHC.Types.SrcLoc import GHC.Driver.Types -import ListSetOps -import Outputable +import GHC.Data.List.SetOps +import GHC.Utils.Outputable as Outputable import GHC.Core.ConLike import GHC.Core.DataCon import GHC.Core.Type @@ -130,10 +130,10 @@ import GHC.Core.Coercion.Axiom import GHC.Types.Annotations import Data.List ( find, sortBy, sort ) import Data.Ord -import FastString -import Maybes -import Util -import Bag +import GHC.Data.FastString +import GHC.Data.Maybe +import GHC.Utils.Misc +import GHC.Data.Bag import GHC.Tc.Utils.Instantiate (tcGetInsts) import qualified GHC.LanguageExtensions as LangExt import Data.Data ( Data ) diff --git a/compiler/GHC/Tc/Module.hs-boot b/compiler/GHC/Tc/Module.hs-boot index f1f5e31e8a..90d775a4e2 100644 --- a/compiler/GHC/Tc/Module.hs-boot +++ b/compiler/GHC/Tc/Module.hs-boot @@ -1,9 +1,9 @@ module GHC.Tc.Module where -import GhcPrelude +import GHC.Prelude import GHC.Core.Type(TyThing) import GHC.Tc.Types (TcM) -import Outputable (SDoc) +import GHC.Utils.Outputable (SDoc) import GHC.Types.Name (Name) checkBootDeclM :: Bool -- ^ True <=> an hs-boot file (could also be a sig) diff --git a/compiler/GHC/Tc/Plugin.hs b/compiler/GHC/Tc/Plugin.hs index cde159815f..228647767d 100644 --- a/compiler/GHC/Tc/Plugin.hs +++ b/compiler/GHC/Tc/Plugin.hs @@ -50,7 +50,7 @@ module GHC.Tc.Plugin ( getEvBindsTcPluginM ) where -import GhcPrelude +import GHC.Prelude import qualified GHC.Tc.Utils.Monad as TcM import qualified GHC.Tc.Solver.Monad as TcS @@ -77,12 +77,12 @@ import GHC.Core.TyCon import GHC.Core.DataCon import GHC.Core.Class import GHC.Driver.Types -import Outputable +import GHC.Utils.Outputable import GHC.Core.Type import GHC.Core.Coercion ( BlockSubstFlag(..) ) import GHC.Types.Id import GHC.Core.InstEnv -import FastString +import GHC.Data.FastString import GHC.Types.Unique diff --git a/compiler/GHC/Tc/Solver.hs b/compiler/GHC/Tc/Solver.hs index c060eac638..92b739f00b 100644 --- a/compiler/GHC/Tc/Solver.hs +++ b/compiler/GHC/Tc/Solver.hs @@ -26,16 +26,16 @@ module GHC.Tc.Solver( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Bag +import GHC.Data.Bag import GHC.Core.Class ( Class, classKey, classTyCon ) import GHC.Driver.Session import GHC.Types.Id ( idType, mkLocalId ) import GHC.Tc.Utils.Instantiate -import ListSetOps +import GHC.Data.List.SetOps import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Utils import GHC.Builtin.Names import GHC.Tc.Errors @@ -52,19 +52,19 @@ import GHC.Tc.Utils.TcType import GHC.Core.Type import GHC.Builtin.Types ( liftedRepTy ) import GHC.Core.Unify ( tcMatchTyKi ) -import Util +import GHC.Utils.Misc import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Unique.Set import GHC.Types.Basic ( IntWithInf, intGtLimit ) -import ErrUtils ( emptyMessages ) +import GHC.Utils.Error ( emptyMessages ) import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Data.Foldable ( toList ) import Data.List ( partition ) import Data.List.NonEmpty ( NonEmpty(..) ) -import Maybes ( isJust ) +import GHC.Data.Maybe ( isJust ) {- ********************************************************************************* diff --git a/compiler/GHC/Tc/Solver/Canonical.hs b/compiler/GHC/Tc/Solver/Canonical.hs index c9d93b063e..5a231f2e44 100644 --- a/compiler/GHC/Tc/Solver/Canonical.hs +++ b/compiler/GHC/Tc/Solver/Canonical.hs @@ -11,7 +11,7 @@ module GHC.Tc.Solver.Canonical( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types.Constraint import GHC.Core.Predicate @@ -35,16 +35,16 @@ import GHC.Types.Var import GHC.Types.Var.Env( mkInScopeSet ) import GHC.Types.Var.Set( delVarSetList ) import GHC.Types.Name.Occurrence ( OccName ) -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Session( DynFlags ) import GHC.Types.Name.Set import GHC.Types.Name.Reader import GHC.Hs.Types( HsIPName(..) ) -import Pair -import Util -import Bag -import MonadUtils +import GHC.Data.Pair +import GHC.Utils.Misc +import GHC.Data.Bag +import GHC.Utils.Monad import Control.Monad import Data.Maybe ( isJust ) import Data.List ( zip4 ) diff --git a/compiler/GHC/Tc/Solver/Flatten.hs b/compiler/GHC/Tc/Solver/Flatten.hs index e1a290fdf9..551e1de395 100644 --- a/compiler/GHC/Tc/Solver/Flatten.hs +++ b/compiler/GHC/Tc/Solver/Flatten.hs @@ -12,7 +12,7 @@ module GHC.Tc.Solver.Flatten( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types import GHC.Core.TyCo.Ppr ( pprTyVar ) @@ -27,14 +27,14 @@ import GHC.Core.Coercion import GHC.Types.Var import GHC.Types.Var.Set import GHC.Types.Var.Env -import Outputable +import GHC.Utils.Outputable import GHC.Tc.Solver.Monad as TcS import GHC.Types.Basic( SwapFlag(..) ) -import Util -import Bag +import GHC.Utils.Misc +import GHC.Data.Bag import Control.Monad -import MonadUtils ( zipWith3M ) +import GHC.Utils.Monad ( zipWith3M ) import Data.Foldable ( foldrM ) import Control.Arrow ( first ) diff --git a/compiler/GHC/Tc/Solver/Interact.hs b/compiler/GHC/Tc/Solver/Interact.hs index acb9ca5543..6a391d4406 100644 --- a/compiler/GHC/Tc/Solver/Interact.hs +++ b/compiler/GHC/Tc/Solver/Interact.hs @@ -10,7 +10,7 @@ module GHC.Tc.Solver.Interact ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic ( SwapFlag(..), isSwapped, infinity, IntWithInf, intGtLimit ) import GHC.Tc.Solver.Canonical @@ -36,15 +36,15 @@ import GHC.Core.FamInstEnv import GHC.Core.Unify ( tcUnifyTyWithTFs, ruleMatchTyKiX ) import GHC.Tc.Types.Evidence -import Outputable +import GHC.Utils.Outputable import GHC.Tc.Types import GHC.Tc.Types.Constraint import GHC.Core.Predicate import GHC.Tc.Types.Origin import GHC.Tc.Solver.Monad -import Bag -import MonadUtils ( concatMapM, foldlM ) +import GHC.Data.Bag +import GHC.Utils.Monad ( concatMapM, foldlM ) import GHC.Core import Data.List( partition, deleteFirstsBy ) @@ -52,11 +52,11 @@ import GHC.Types.SrcLoc import GHC.Types.Var.Env import Control.Monad -import Maybes( isJust ) -import Pair (Pair(..)) +import GHC.Data.Maybe( isJust ) +import GHC.Data.Pair (Pair(..)) import GHC.Types.Unique( hasKey ) import GHC.Driver.Session -import Util +import GHC.Utils.Misc import qualified GHC.LanguageExtensions as LangExt import Control.Monad.Trans.Class diff --git a/compiler/GHC/Tc/Solver/Monad.hs b/compiler/GHC/Tc/Solver/Monad.hs index 822ccb2248..0baad1ff4b 100644 --- a/compiler/GHC/Tc/Solver/Monad.hs +++ b/compiler/GHC/Tc/Solver/Monad.hs @@ -127,7 +127,7 @@ module GHC.Tc.Solver.Monad ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Types @@ -148,7 +148,7 @@ import GHC.Core.Type import GHC.Core.Coercion import GHC.Core.Unify -import ErrUtils +import GHC.Utils.Error import GHC.Tc.Types.Evidence import GHC.Core.Class import GHC.Core.TyCon @@ -161,10 +161,10 @@ import qualified GHC.Rename.Env as TcM import GHC.Types.Var import GHC.Types.Var.Env import GHC.Types.Var.Set -import Outputable -import Bag +import GHC.Utils.Outputable +import GHC.Data.Bag as Bag import GHC.Types.Unique.Supply -import Util +import GHC.Utils.Misc import GHC.Tc.Types import GHC.Tc.Types.Origin import GHC.Tc.Types.Constraint @@ -173,16 +173,16 @@ import GHC.Core.Predicate import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import Maybes +import GHC.Data.Maybe import GHC.Core.Map import Control.Monad -import MonadUtils +import GHC.Utils.Monad import Data.IORef import Data.List ( partition, mapAccumL ) #if defined(DEBUG) -import Digraph +import GHC.Data.Graph.Directed import GHC.Types.Unique.Set #endif @@ -2860,7 +2860,7 @@ checkForCyclicBinds ev_binds_map -- It's OK to use nonDetEltsUFM here as -- stronglyConnCompFromEdgedVertices is still deterministic even -- if the edges are in nondeterministic order as explained in - -- Note [Deterministic SCC] in Digraph. + -- Note [Deterministic SCC] in GHC.Data.Graph.Directed. #endif ---------------------------- diff --git a/compiler/GHC/Tc/TyCl.hs b/compiler/GHC/Tc/TyCl.hs index e69990cb63..1f44338a4c 100644 --- a/compiler/GHC/Tc/TyCl.hs +++ b/compiler/GHC/Tc/TyCl.hs @@ -25,7 +25,7 @@ module GHC.Tc.TyCl ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Driver.Types @@ -64,12 +64,12 @@ import GHC.Types.Module import GHC.Types.Name import GHC.Types.Name.Set import GHC.Types.Name.Env -import Outputable -import Maybes +import GHC.Utils.Outputable +import GHC.Data.Maybe import GHC.Core.Unify -import Util +import GHC.Utils.Misc import GHC.Types.SrcLoc -import ListSetOps +import GHC.Data.List.SetOps import GHC.Driver.Session import GHC.Types.Unique import GHC.Core.ConLike( ConLike(..) ) diff --git a/compiler/GHC/Tc/TyCl/Build.hs b/compiler/GHC/Tc/TyCl/Build.hs index 908f1398d7..fa0c196504 100644 --- a/compiler/GHC/Tc/TyCl/Build.hs +++ b/compiler/GHC/Tc/TyCl/Build.hs @@ -17,7 +17,7 @@ module GHC.Tc.TyCl.Build ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Iface.Env import GHC.Core.FamInstEnv( FamInstEnvs, mkNewTypeCoAxiom ) @@ -41,8 +41,8 @@ import GHC.Types.SrcLoc( SrcSpan, noSrcSpan ) import GHC.Driver.Session import GHC.Tc.Utils.Monad import GHC.Types.Unique.Supply -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable mkNewTyConRhs :: Name -> TyCon -> DataCon -> TcRnIf m n AlgTyConRhs diff --git a/compiler/GHC/Tc/TyCl/Class.hs b/compiler/GHC/Tc/TyCl/Class.hs index 55105f84ff..cedd42916b 100644 --- a/compiler/GHC/Tc/TyCl/Class.hs +++ b/compiler/GHC/Tc/TyCl/Class.hs @@ -28,7 +28,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Utils.Env @@ -56,15 +56,15 @@ import GHC.Types.Name.Env import GHC.Types.Name.Set import GHC.Types.Var import GHC.Types.Var.Env -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Core.TyCon -import Maybes +import GHC.Data.Maybe import GHC.Types.Basic -import Bag -import FastString -import BooleanFormula -import Util +import GHC.Data.Bag +import GHC.Data.FastString +import GHC.Data.BooleanFormula +import GHC.Utils.Misc import Control.Monad import Data.List ( mapAccumL, partition ) diff --git a/compiler/GHC/Tc/TyCl/Instance.hs b/compiler/GHC/Tc/TyCl/Instance.hs index a716c9671f..22849451bf 100644 --- a/compiler/GHC/Tc/TyCl/Instance.hs +++ b/compiler/GHC/Tc/TyCl/Instance.hs @@ -21,7 +21,7 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Gen.Bind @@ -61,24 +61,24 @@ import GHC.Core.Class import GHC.Types.Var as Var import GHC.Types.Var.Env import GHC.Types.Var.Set -import Bag +import GHC.Data.Bag import GHC.Types.Basic import GHC.Driver.Session -import ErrUtils -import FastString +import GHC.Utils.Error +import GHC.Data.FastString import GHC.Types.Id -import ListSetOps +import GHC.Data.List.SetOps import GHC.Types.Name import GHC.Types.Name.Set -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import Util -import BooleanFormula ( isUnsatisfied, pprBooleanFormulaNice ) +import GHC.Utils.Misc +import GHC.Data.BooleanFormula ( isUnsatisfied, pprBooleanFormulaNice ) import qualified GHC.LanguageExtensions as LangExt import Control.Monad import Data.Tuple -import Maybes +import GHC.Data.Maybe import Data.List( mapAccumL ) diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs b/compiler/GHC/Tc/TyCl/PatSyn.hs index 37ba4e3329..00e0beb5e1 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs @@ -20,7 +20,7 @@ module GHC.Tc.TyCl.PatSyn ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Tc.Gen.Pat @@ -35,9 +35,9 @@ import GHC.Types.Name import GHC.Types.SrcLoc import GHC.Core.PatSyn import GHC.Types.Name.Set -import Panic -import Outputable -import FastString +import GHC.Utils.Panic +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Var import GHC.Types.Var.Env( emptyTidyEnv, mkInScopeSet ) import GHC.Types.Id @@ -57,9 +57,9 @@ import GHC.Types.Id.Make import GHC.Tc.TyCl.Utils import GHC.Core.ConLike import GHC.Types.FieldLabel -import Bag -import Util -import ErrUtils +import GHC.Data.Bag +import GHC.Utils.Misc +import GHC.Utils.Error import Data.Maybe( mapMaybe ) import Control.Monad ( zipWithM ) import Data.List( partition ) diff --git a/compiler/GHC/Tc/TyCl/PatSyn.hs-boot b/compiler/GHC/Tc/TyCl/PatSyn.hs-boot index 44be72781d..fb4ac51013 100644 --- a/compiler/GHC/Tc/TyCl/PatSyn.hs-boot +++ b/compiler/GHC/Tc/TyCl/PatSyn.hs-boot @@ -3,7 +3,7 @@ module GHC.Tc.TyCl.PatSyn where import GHC.Hs ( PatSynBind, LHsBinds ) import GHC.Tc.Types ( TcM, TcSigInfo ) import GHC.Tc.Utils.Monad ( TcGblEnv) -import Outputable ( Outputable ) +import GHC.Utils.Outputable ( Outputable ) import GHC.Hs.Extension ( GhcRn, GhcTc ) import Data.Maybe ( Maybe ) diff --git a/compiler/GHC/Tc/TyCl/Utils.hs b/compiler/GHC/Tc/TyCl/Utils.hs index 5ee3620db1..890222b8aa 100644 --- a/compiler/GHC/Tc/TyCl/Utils.hs +++ b/compiler/GHC/Tc/TyCl/Utils.hs @@ -30,7 +30,7 @@ module GHC.Tc.TyCl.Utils( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.Monad import GHC.Tc.Utils.Env @@ -59,12 +59,12 @@ import GHC.Core.Coercion ( ltRole ) import GHC.Types.Basic import GHC.Types.SrcLoc import GHC.Types.Unique ( mkBuiltinUnique ) -import Outputable -import Util -import Maybes -import Bag -import FastString -import FV +import GHC.Utils.Outputable +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Data.Bag +import GHC.Data.FastString +import GHC.Utils.FV as FV import GHC.Types.Module import qualified GHC.LanguageExtensions as LangExt diff --git a/compiler/GHC/Tc/Types.hs b/compiler/GHC/Tc/Types.hs index 8c4086a2ca..be345c4f30 100644 --- a/compiler/GHC/Tc/Types.hs +++ b/compiler/GHC/Tc/Types.hs @@ -84,7 +84,7 @@ module GHC.Tc.Types( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Platform import GHC.Hs @@ -102,7 +102,7 @@ import GHC.Types.Annotations import GHC.Core.InstEnv import GHC.Core.FamInstEnv import {-# SOURCE #-} GHC.HsToCore.PmCheck.Types (Deltas) -import IOEnv +import GHC.Data.IOEnv import GHC.Types.Name.Reader import GHC.Types.Name import GHC.Types.Name.Env @@ -113,15 +113,15 @@ import GHC.Types.Var.Env import GHC.Types.Module import GHC.Types.SrcLoc import GHC.Types.Var.Set -import ErrUtils +import GHC.Utils.Error import GHC.Types.Unique.FM import GHC.Types.Basic -import Bag +import GHC.Data.Bag import GHC.Driver.Session -import Outputable -import ListSetOps -import Fingerprint -import Util +import GHC.Utils.Outputable +import GHC.Data.List.SetOps +import GHC.Utils.Fingerprint +import GHC.Utils.Misc import GHC.Builtin.Names ( isUnboundName ) import GHC.Types.CostCentre.State @@ -1167,7 +1167,7 @@ For (static e) to be valid, we need for every 'x' free in 'e', that x's binding is floatable to the top level. Specifically: * x's RhsNames must be empty * x's type has no free variables -See Note [Grand plan for static forms] in StaticPtrTable.hs. +See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.hs. This test is made in GHC.Tc.Gen.Expr.checkClosedInStaticForm. Actually knowing x's RhsNames (rather than just its emptiness or otherwise) is just so we can produce better error messages diff --git a/compiler/GHC/Tc/Types/Constraint.hs b/compiler/GHC/Tc/Types/Constraint.hs index 3f85594c97..fdfd13e339 100644 --- a/compiler/GHC/Tc/Types/Constraint.hs +++ b/compiler/GHC/Tc/Types/Constraint.hs @@ -70,7 +70,7 @@ module GHC.Tc.Types.Constraint ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Types ( TcLclEnv, setLclEnvTcLevel, getLclEnvTcLevel , setLclEnvLoc, getLclEnvLoc ) @@ -90,15 +90,15 @@ import GHC.Core import GHC.Core.TyCo.Ppr import GHC.Types.Name.Occurrence -import FV +import GHC.Utils.FV import GHC.Types.Var.Set import GHC.Driver.Session import GHC.Types.Basic -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import Bag -import Util +import GHC.Data.Bag +import GHC.Utils.Misc import Control.Monad ( msum ) @@ -439,12 +439,12 @@ tyCoVarsOfCt :: Ct -> TcTyCoVarSet tyCoVarsOfCt = fvVarSet . tyCoFVsOfCt -- | Returns free variables of constraints as a deterministically ordered. --- list. See Note [Deterministic FV] in FV. +-- list. See Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfCtList :: Ct -> [TcTyCoVar] tyCoVarsOfCtList = fvVarList . tyCoFVsOfCt -- | Returns free variables of constraints as a composable FV computation. --- See Note [Deterministic FV] in FV. +-- See Note [Deterministic FV] in GHC.Utils.FV. tyCoFVsOfCt :: Ct -> FV tyCoFVsOfCt ct = tyCoFVsOfType (ctPred ct) -- This must consult only the ctPred, so that it gets *tidied* fvs if the @@ -452,34 +452,34 @@ tyCoFVsOfCt ct = tyCoFVsOfType (ctPred ct) -- fields of the Ct, only the predicate in the CtEvidence. -- | Returns free variables of a bag of constraints as a non-deterministic --- set. See Note [Deterministic FV] in FV. +-- set. See Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfCts :: Cts -> TcTyCoVarSet tyCoVarsOfCts = fvVarSet . tyCoFVsOfCts -- | Returns free variables of a bag of constraints as a deterministically --- ordered list. See Note [Deterministic FV] in FV. +-- ordered list. See Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfCtsList :: Cts -> [TcTyCoVar] tyCoVarsOfCtsList = fvVarList . tyCoFVsOfCts -- | Returns free variables of a bag of constraints as a composable FV --- computation. See Note [Deterministic FV] in FV. +-- computation. See Note [Deterministic FV] in GHC.Utils.FV. tyCoFVsOfCts :: Cts -> FV tyCoFVsOfCts = foldr (unionFV . tyCoFVsOfCt) emptyFV -- | Returns free variables of WantedConstraints as a non-deterministic --- set. See Note [Deterministic FV] in FV. +-- set. See Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfWC :: WantedConstraints -> TyCoVarSet -- Only called on *zonked* things, hence no need to worry about flatten-skolems tyCoVarsOfWC = fvVarSet . tyCoFVsOfWC -- | Returns free variables of WantedConstraints as a deterministically --- ordered list. See Note [Deterministic FV] in FV. +-- ordered list. See Note [Deterministic FV] in GHC.Utils.FV. tyCoVarsOfWCList :: WantedConstraints -> [TyCoVar] -- Only called on *zonked* things, hence no need to worry about flatten-skolems tyCoVarsOfWCList = fvVarList . tyCoFVsOfWC -- | Returns free variables of WantedConstraints as a composable FV --- computation. See Note [Deterministic FV] in FV. +-- computation. See Note [Deterministic FV] in GHC.Utils.FV. tyCoFVsOfWC :: WantedConstraints -> FV -- Only called on *zonked* things, hence no need to worry about flatten-skolems tyCoFVsOfWC (WC { wc_simple = simple, wc_impl = implic }) @@ -487,7 +487,7 @@ tyCoFVsOfWC (WC { wc_simple = simple, wc_impl = implic }) tyCoFVsOfBag tyCoFVsOfImplic implic -- | Returns free variables of Implication as a composable FV computation. --- See Note [Deterministic FV] in FV. +-- See Note [Deterministic FV] in GHC.Utils.FV. tyCoFVsOfImplic :: Implication -> FV -- Only called on *zonked* things, hence no need to worry about flatten-skolems tyCoFVsOfImplic (Implic { ic_skols = skols diff --git a/compiler/GHC/Tc/Types/EvTerm.hs b/compiler/GHC/Tc/Types/EvTerm.hs index 09f016ca71..1352ceca90 100644 --- a/compiler/GHC/Tc/Types/EvTerm.hs +++ b/compiler/GHC/Tc/Types/EvTerm.hs @@ -4,9 +4,9 @@ module GHC.Tc.Types.EvTerm ( evDelayedError, evCallStack ) where -import GhcPrelude +import GHC.Prelude -import FastString +import GHC.Data.FastString import GHC.Core.Type import GHC.Core import GHC.Core.Make diff --git a/compiler/GHC/Tc/Types/Evidence.hs b/compiler/GHC/Tc/Types/Evidence.hs index 922055ebf5..9c7e237ffe 100644 --- a/compiler/GHC/Tc/Types/Evidence.hs +++ b/compiler/GHC/Tc/Types/Evidence.hs @@ -53,7 +53,7 @@ module GHC.Tc.Types.Evidence ( ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Var import GHC.Core.Coercion.Axiom @@ -69,16 +69,16 @@ import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Core.Predicate import GHC.Types.Name -import Pair +import GHC.Data.Pair import GHC.Core import GHC.Core.Class ( classSCSelId ) import GHC.Core.FVs ( exprSomeFreeVars ) -import Util -import Bag +import GHC.Utils.Misc +import GHC.Data.Bag import qualified Data.Data as Data -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import Data.IORef( IORef ) import GHC.Types.Unique.Set diff --git a/compiler/GHC/Tc/Types/Origin.hs b/compiler/GHC/Tc/Types/Origin.hs index 86427853de..d21f594aef 100644 --- a/compiler/GHC/Tc/Types/Origin.hs +++ b/compiler/GHC/Tc/Types/Origin.hs @@ -22,7 +22,7 @@ module GHC.Tc.Types.Origin ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.TcType @@ -40,8 +40,8 @@ import GHC.Types.Name import GHC.Types.Name.Reader import GHC.Types.SrcLoc -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.Basic {- ********************************************************************* diff --git a/compiler/GHC/Tc/Utils/Backpack.hs b/compiler/GHC/Tc/Utils/Backpack.hs index fc134817be..98999e57c8 100644 --- a/compiler/GHC/Tc/Utils/Backpack.hs +++ b/compiler/GHC/Tc/Utils/Backpack.hs @@ -18,7 +18,7 @@ module GHC.Tc.Utils.Backpack ( instantiateSignature, ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic (defaultFixity, TypeOrKind(..)) import GHC.Driver.Packages @@ -39,7 +39,7 @@ import GHC.Tc.Types.Constraint import GHC.Tc.Types.Origin import GHC.Iface.Load import GHC.Rename.Names -import ErrUtils +import GHC.Utils.Error import GHC.Types.Id import GHC.Types.Module import GHC.Types.Name @@ -48,11 +48,11 @@ import GHC.Types.Name.Set import GHC.Types.Avail import GHC.Types.SrcLoc import GHC.Driver.Types -import Outputable +import GHC.Utils.Outputable import GHC.Core.Type -import FastString +import GHC.Data.FastString import GHC.Rename.Fixity ( lookupFixityRn ) -import Maybes +import GHC.Data.Maybe import GHC.Tc.Utils.Env import GHC.Types.Var import GHC.Iface.Syntax @@ -65,7 +65,7 @@ import GHC.Types.Name.Shape import GHC.Tc.Errors import GHC.Tc.Utils.Unify import GHC.Iface.Rename -import Util +import GHC.Utils.Misc import Control.Monad import Data.List (find) diff --git a/compiler/GHC/Tc/Utils/Env.hs b/compiler/GHC/Tc/Utils/Env.hs index cf55316b22..d1a92298db 100644 --- a/compiler/GHC/Tc/Utils/Env.hs +++ b/compiler/GHC/Tc/Utils/Env.hs @@ -71,7 +71,7 @@ module GHC.Tc.Utils.Env( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Iface.Env @@ -101,15 +101,15 @@ import GHC.Driver.Session import GHC.Types.SrcLoc import GHC.Types.Basic hiding( SuccessFlag(..) ) import GHC.Types.Module -import Outputable -import Encoding -import FastString -import Bag -import ListSetOps -import ErrUtils -import Maybes( MaybeErr(..), orElse ) +import GHC.Utils.Outputable +import GHC.Utils.Encoding +import GHC.Data.FastString +import GHC.Data.Bag +import GHC.Data.List.SetOps +import GHC.Utils.Error +import GHC.Data.Maybe( MaybeErr(..), orElse ) import qualified GHC.LanguageExtensions as LangExt -import Util ( HasDebugCallStack ) +import GHC.Utils.Misc ( HasDebugCallStack ) import Data.IORef import Data.List (intercalate) diff --git a/compiler/GHC/Tc/Utils/Instantiate.hs b/compiler/GHC/Tc/Utils/Instantiate.hs index 7e45b5d947..ea8ffd912b 100644 --- a/compiler/GHC/Tc/Utils/Instantiate.hs +++ b/compiler/GHC/Tc/Utils/Instantiate.hs @@ -34,13 +34,13 @@ module GHC.Tc.Utils.Instantiate ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Tc.Gen.Expr( tcCheckExpr, tcSyntaxOp ) import {-# SOURCE #-} GHC.Tc.Utils.Unify( unifyType, unifyKind ) import GHC.Types.Basic ( IntegralLit(..), SourceText(..) ) -import FastString +import GHC.Data.FastString import GHC.Hs import GHC.Tc.Utils.Zonk import GHC.Tc.Utils.Monad @@ -70,8 +70,8 @@ import GHC.Types.Var.Env import GHC.Builtin.Names import GHC.Types.SrcLoc as SrcLoc import GHC.Driver.Session -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Types.Basic ( TypeOrKind(..) ) import qualified GHC.LanguageExtensions as LangExt diff --git a/compiler/GHC/Tc/Utils/Monad.hs b/compiler/GHC/Tc/Utils/Monad.hs index 918a71594d..60714e4cc1 100644 --- a/compiler/GHC/Tc/Utils/Monad.hs +++ b/compiler/GHC/Tc/Utils/Monad.hs @@ -138,15 +138,15 @@ module GHC.Tc.Utils.Monad( -- * Types etc. module GHC.Tc.Types, - module IOEnv + module GHC.Data.IOEnv ) where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Tc.Types -- Re-export all -import IOEnv -- Re-export all +import GHC.Data.IOEnv -- Re-export all import GHC.Tc.Types.Constraint import GHC.Tc.Types.Evidence import GHC.Tc.Types.Origin @@ -166,20 +166,20 @@ import GHC.Builtin.Names import GHC.Types.Id import GHC.Types.Var.Set import GHC.Types.Var.Env -import ErrUtils +import GHC.Utils.Error import GHC.Types.SrcLoc import GHC.Types.Name.Env import GHC.Types.Name.Set -import Bag -import Outputable +import GHC.Data.Bag +import GHC.Utils.Outputable as Outputable import GHC.Types.Unique.Supply import GHC.Driver.Session -import FastString -import Panic -import Util +import GHC.Data.FastString +import GHC.Utils.Panic +import GHC.Utils.Misc import GHC.Types.Annotations import GHC.Types.Basic( TopLevelFlag, TypeOrKind(..) ) -import Maybes +import GHC.Data.Maybe import GHC.Types.CostCentre.State import qualified GHC.LanguageExtensions as LangExt diff --git a/compiler/GHC/Tc/Utils/TcMType.hs b/compiler/GHC/Tc/Utils/TcMType.hs index d37b37efe3..1189a57cd7 100644 --- a/compiler/GHC/Tc/Utils/TcMType.hs +++ b/compiler/GHC/Tc/Utils/TcMType.hs @@ -94,7 +94,7 @@ module GHC.Tc.Utils.TcMType ( #include "HsVersions.h" -- friends: -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCo.Rep import GHC.Core.TyCo.Ppr @@ -119,18 +119,18 @@ import GHC.Builtin.Types.Prim import GHC.Types.Var.Env import GHC.Types.Name.Env import GHC.Builtin.Names -import Util -import Outputable -import FastString -import Bag -import Pair +import GHC.Utils.Misc +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.Bag +import GHC.Data.Pair import GHC.Types.Unique.Set import GHC.Driver.Session import qualified GHC.LanguageExtensions as LangExt import GHC.Types.Basic ( TypeOrKind(..) ) import Control.Monad -import Maybes +import GHC.Data.Maybe import Data.List ( mapAccumL ) import Control.Arrow ( second ) import qualified Data.Semigroup as Semi diff --git a/compiler/GHC/Tc/Utils/TcType.hs b/compiler/GHC/Tc/Utils/TcType.hs index dc1ef3a69e..693fd1f132 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs +++ b/compiler/GHC/Tc/Utils/TcType.hs @@ -189,7 +189,7 @@ module GHC.Tc.Utils.TcType ( #include "HsVersions.h" -- friends: -import GhcPrelude +import GHC.Prelude import GHC.Core.TyCo.Rep import GHC.Core.TyCo.Subst ( mkTvSubst, substTyWithCoVars ) @@ -217,12 +217,12 @@ import GHC.Builtin.Names import GHC.Builtin.Types ( coercibleClass, eqClass, heqClass, unitTyCon, unitTyConKey , listTyCon, constraintKind ) import GHC.Types.Basic -import Util -import Maybes -import ListSetOps ( getNth, findDupsEq ) -import Outputable -import FastString -import ErrUtils( Validity(..), MsgDoc, isValid ) +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Data.List.SetOps ( getNth, findDupsEq ) +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Utils.Error( Validity(..), MsgDoc, isValid ) import qualified GHC.LanguageExtensions as LangExt import Data.List ( mapAccumL ) diff --git a/compiler/GHC/Tc/Utils/TcType.hs-boot b/compiler/GHC/Tc/Utils/TcType.hs-boot index 481d261f79..dc5f4cf73f 100644 --- a/compiler/GHC/Tc/Utils/TcType.hs-boot +++ b/compiler/GHC/Tc/Utils/TcType.hs-boot @@ -1,5 +1,5 @@ module GHC.Tc.Utils.TcType where -import Outputable( SDoc ) +import GHC.Utils.Outputable( SDoc ) data MetaDetails diff --git a/compiler/GHC/Tc/Utils/Unify.hs b/compiler/GHC/Tc/Utils/Unify.hs index 6a4d61627b..7c14e56319 100644 --- a/compiler/GHC/Tc/Utils/Unify.hs +++ b/compiler/GHC/Tc/Utils/Unify.hs @@ -40,7 +40,7 @@ module GHC.Tc.Utils.Unify ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Core.TyCo.Rep @@ -62,13 +62,13 @@ import GHC.Builtin.Types.Prim( tYPE ) import GHC.Types.Var as Var import GHC.Types.Var.Set import GHC.Types.Var.Env -import ErrUtils +import GHC.Utils.Error import GHC.Driver.Session import GHC.Types.Basic -import Bag -import Util +import GHC.Data.Bag +import GHC.Utils.Misc import qualified GHC.LanguageExtensions as LangExt -import Outputable +import GHC.Utils.Outputable as Outputable import Data.Maybe( isNothing ) import Control.Monad diff --git a/compiler/GHC/Tc/Utils/Unify.hs-boot b/compiler/GHC/Tc/Utils/Unify.hs-boot index a281bf136b..36f3367634 100644 --- a/compiler/GHC/Tc/Utils/Unify.hs-boot +++ b/compiler/GHC/Tc/Utils/Unify.hs-boot @@ -1,6 +1,6 @@ module GHC.Tc.Utils.Unify where -import GhcPrelude +import GHC.Prelude import GHC.Tc.Utils.TcType ( TcTauType ) import GHC.Tc.Types ( TcM ) import GHC.Tc.Types.Evidence ( TcCoercion ) diff --git a/compiler/GHC/Tc/Utils/Zonk.hs b/compiler/GHC/Tc/Utils/Zonk.hs index 09caf5fefa..8fbbba22b1 100644 --- a/compiler/GHC/Tc/Utils/Zonk.hs +++ b/compiler/GHC/Tc/Utils/Zonk.hs @@ -46,7 +46,7 @@ module GHC.Tc.Utils.Zonk ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Hs import GHC.Types.Id @@ -74,11 +74,11 @@ import GHC.Types.Var import GHC.Types.Var.Env import GHC.Platform import GHC.Types.Basic -import Maybes +import GHC.Data.Maybe import GHC.Types.SrcLoc -import Bag -import Outputable -import Util +import GHC.Data.Bag +import GHC.Utils.Outputable +import GHC.Utils.Misc import GHC.Types.Unique.FM import GHC.Core diff --git a/compiler/GHC/Tc/Validity.hs b/compiler/GHC/Tc/Validity.hs index c72d4cd357..7b9d1192bd 100644 --- a/compiler/GHC/Tc/Validity.hs +++ b/compiler/GHC/Tc/Validity.hs @@ -22,9 +22,9 @@ module GHC.Tc.Validity ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Maybes +import GHC.Data.Maybe -- friends: import GHC.Tc.Utils.Unify ( tcSubType_NC ) @@ -59,15 +59,15 @@ import GHC.Types.Name import GHC.Types.Var.Env import GHC.Types.Var.Set import GHC.Types.Var ( VarBndr(..), mkTyVar ) -import FV -import ErrUtils +import GHC.Utils.FV +import GHC.Utils.Error import GHC.Driver.Session -import Util -import ListSetOps +import GHC.Utils.Misc +import GHC.Data.List.SetOps import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable as Outputable import GHC.Types.Unique ( mkAlphaTyVarUnique ) -import Bag ( emptyBag ) +import GHC.Data.Bag ( emptyBag ) import qualified GHC.LanguageExtensions as LangExt import Control.Monad diff --git a/compiler/GHC/ThToHs.hs b/compiler/GHC/ThToHs.hs index 622ab13403..aad08d862e 100644 --- a/compiler/GHC/ThToHs.hs +++ b/compiler/GHC/ThToHs.hs @@ -24,7 +24,7 @@ module GHC.ThToHs ) where -import GhcPrelude +import GHC.Prelude import GHC.Hs as Hs import GHC.Builtin.Names @@ -40,13 +40,13 @@ import GHC.Builtin.Types import GHC.Types.Basic as Hs import GHC.Types.ForeignCall import GHC.Types.Unique -import ErrUtils -import Bag +import GHC.Utils.Error +import GHC.Data.Bag import GHC.Utils.Lexeme -import Util -import FastString -import Outputable -import MonadUtils ( foldrM ) +import GHC.Utils.Misc +import GHC.Data.FastString +import GHC.Utils.Outputable as Outputable +import GHC.Utils.Monad ( foldrM ) import qualified Data.ByteString as BS import Control.Monad( unless, ap ) diff --git a/compiler/GHC/Types/Annotations.hs b/compiler/GHC/Types/Annotations.hs index 4dde431ab5..c096558651 100644 --- a/compiler/GHC/Types/Annotations.hs +++ b/compiler/GHC/Types/Annotations.hs @@ -17,16 +17,16 @@ module GHC.Types.Annotations ( deserializeAnns ) where -import GhcPrelude +import GHC.Prelude -import Binary +import GHC.Utils.Binary import GHC.Types.Module ( Module , ModuleEnv, emptyModuleEnv, extendModuleEnvWith , plusModuleEnv_C, lookupWithDefaultModuleEnv , mapModuleEnv ) import GHC.Types.Name.Env import GHC.Types.Name -import Outputable +import GHC.Utils.Outputable import GHC.Serialized import Control.Monad diff --git a/compiler/GHC/Types/Avail.hs b/compiler/GHC/Types/Avail.hs index 8730ce2e88..bee35d9395 100644 --- a/compiler/GHC/Types/Avail.hs +++ b/compiler/GHC/Types/Avail.hs @@ -28,17 +28,17 @@ module GHC.Types.Avail ( ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Name import GHC.Types.Name.Env import GHC.Types.Name.Set import GHC.Types.FieldLabel -import Binary -import ListSetOps -import Outputable -import Util +import GHC.Utils.Binary +import GHC.Data.List.SetOps +import GHC.Utils.Outputable +import GHC.Utils.Misc import Data.Data ( Data ) import Data.List ( find ) diff --git a/compiler/GHC/Types/Basic.hs b/compiler/GHC/Types/Basic.hs index 103b1940a0..bbffb143cc 100644 --- a/compiler/GHC/Types/Basic.hs +++ b/compiler/GHC/Types/Basic.hs @@ -113,10 +113,10 @@ module GHC.Types.Basic ( TypeOrKind(..), isTypeLevel, isKindLevel ) where -import GhcPrelude +import GHC.Prelude -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.SrcLoc ( Located,unLoc ) import Data.Data hiding (Fixity, Prefix, Infix) import Data.Function (on) diff --git a/compiler/GHC/Types/CostCentre.hs b/compiler/GHC/Types/CostCentre.hs index 5280d90d31..a8fb03cef7 100644 --- a/compiler/GHC/Types/CostCentre.hs +++ b/compiler/GHC/Types/CostCentre.hs @@ -20,17 +20,17 @@ module GHC.Types.CostCentre ( cmpCostCentre -- used for removing dups in a list ) where -import GhcPrelude +import GHC.Prelude -import Binary +import GHC.Utils.Binary import GHC.Types.Var import GHC.Types.Name import GHC.Types.Module import GHC.Types.Unique -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc import GHC.Types.CostCentre.State import Data.Data diff --git a/compiler/GHC/Types/CostCentre/State.hs b/compiler/GHC/Types/CostCentre/State.hs index 51c364f776..f53034d700 100644 --- a/compiler/GHC/Types/CostCentre/State.hs +++ b/compiler/GHC/Types/CostCentre/State.hs @@ -9,12 +9,12 @@ module GHC.Types.CostCentre.State ) where -import GhcPrelude -import FastString -import FastStringEnv +import GHC.Prelude +import GHC.Data.FastString +import GHC.Data.FastString.Env import Data.Data -import Binary +import GHC.Utils.Binary -- | Per-module state for tracking cost centre indices. -- diff --git a/compiler/GHC/Types/Cpr.hs b/compiler/GHC/Types/Cpr.hs index e19c86142e..403104b8ad 100644 --- a/compiler/GHC/Types/Cpr.hs +++ b/compiler/GHC/Types/Cpr.hs @@ -8,11 +8,11 @@ module GHC.Types.Cpr ( CprSig (..), topCprSig, mkCprSigForArity, mkCprSig, seqCprSig ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic -import Outputable -import Binary +import GHC.Utils.Outputable +import GHC.Utils.Binary -- -- * CprResult diff --git a/compiler/GHC/Types/Demand.hs b/compiler/GHC/Types/Demand.hs index 0ecb1b0b72..a382bda18d 100644 --- a/compiler/GHC/Types/Demand.hs +++ b/compiler/GHC/Types/Demand.hs @@ -58,16 +58,16 @@ module GHC.Types.Demand ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Types.Var ( Var ) import GHC.Types.Var.Env import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import GHC.Types.Basic -import Binary -import Maybes ( orElse ) +import GHC.Utils.Binary +import GHC.Data.Maybe ( orElse ) import GHC.Core.Type ( Type ) import GHC.Core.TyCon ( isNewTyCon, isClassTyCon ) diff --git a/compiler/GHC/Types/FieldLabel.hs b/compiler/GHC/Types/FieldLabel.hs index e73877b292..a392af845e 100644 --- a/compiler/GHC/Types/FieldLabel.hs +++ b/compiler/GHC/Types/FieldLabel.hs @@ -71,15 +71,15 @@ module GHC.Types.FieldLabel ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Name.Occurrence import GHC.Types.Name -import FastString -import FastStringEnv -import Outputable -import Binary +import GHC.Data.FastString +import GHC.Data.FastString.Env +import GHC.Utils.Outputable +import GHC.Utils.Binary import Data.Data diff --git a/compiler/GHC/Types/ForeignCall.hs b/compiler/GHC/Types/ForeignCall.hs index 46cdfd2af3..0ab67c7b35 100644 --- a/compiler/GHC/Types/ForeignCall.hs +++ b/compiler/GHC/Types/ForeignCall.hs @@ -18,11 +18,11 @@ module GHC.Types.ForeignCall ( Header(..), CType(..), ) where -import GhcPrelude +import GHC.Prelude -import FastString -import Binary -import Outputable +import GHC.Data.FastString +import GHC.Utils.Binary +import GHC.Utils.Outputable import GHC.Types.Module import GHC.Types.Basic ( SourceText, pprWithSourceText ) diff --git a/compiler/GHC/Types/Id.hs b/compiler/GHC/Types/Id.hs index 713f1c6258..ebb762dacd 100644 --- a/compiler/GHC/Types/Id.hs +++ b/compiler/GHC/Types/Id.hs @@ -118,7 +118,7 @@ module GHC.Types.Id ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Driver.Session import GHC.Core ( CoreRule, isStableUnfolding, evaldUnfolding, @@ -146,13 +146,13 @@ import GHC.Types.Module import GHC.Core.Class import {-# SOURCE #-} GHC.Builtin.PrimOps (PrimOp) import GHC.Types.ForeignCall -import Maybes +import GHC.Data.Maybe import GHC.Types.SrcLoc -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.Supply -import FastString -import Util +import GHC.Data.FastString +import GHC.Utils.Misc -- infixl so you can say (id `set` a `set` b) infixl 1 `setIdUnfolding`, diff --git a/compiler/GHC/Types/Id/Info.hs b/compiler/GHC/Types/Id/Info.hs index a0a3b94ca9..0e7d2d1b5f 100644 --- a/compiler/GHC/Types/Id/Info.hs +++ b/compiler/GHC/Types/Id/Info.hs @@ -84,7 +84,7 @@ module GHC.Types.Id.Info ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Core hiding( hasCoreUnfolding ) import GHC.Core( hasCoreUnfolding ) @@ -99,11 +99,11 @@ import GHC.Core.TyCon import GHC.Core.PatSyn import GHC.Core.Type import GHC.Types.ForeignCall -import Outputable +import GHC.Utils.Outputable import GHC.Types.Module import GHC.Types.Demand import GHC.Types.Cpr -import Util +import GHC.Utils.Misc -- infixl so you can say (id `set` a `set` b) infixl 1 `setRuleInfo`, diff --git a/compiler/GHC/Types/Id/Info.hs-boot b/compiler/GHC/Types/Id/Info.hs-boot index c6912344aa..1b0e130de3 100644 --- a/compiler/GHC/Types/Id/Info.hs-boot +++ b/compiler/GHC/Types/Id/Info.hs-boot @@ -1,6 +1,6 @@ module GHC.Types.Id.Info where -import GhcPrelude -import Outputable +import GHC.Prelude +import GHC.Utils.Outputable data IdInfo data IdDetails diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs index d9d137a13b..df62ad5469 100644 --- a/compiler/GHC/Types/Id/Make.hs +++ b/compiler/GHC/Types/Id/Make.hs @@ -40,7 +40,7 @@ module GHC.Types.Id.Make ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Types.Prim import GHC.Builtin.Types @@ -71,11 +71,11 @@ import GHC.Types.Unique import GHC.Types.Unique.Supply import GHC.Builtin.Names import GHC.Types.Basic hiding ( SuccessFlag(..) ) -import Util +import GHC.Utils.Misc import GHC.Driver.Session -import Outputable -import FastString -import ListSetOps +import GHC.Utils.Outputable +import GHC.Data.FastString +import GHC.Data.List.SetOps import GHC.Types.Var (VarBndr(Bndr)) import qualified GHC.LanguageExtensions as LangExt diff --git a/compiler/GHC/Types/Literal.hs b/compiler/GHC/Types/Literal.hs index 9c1d08822d..c31f6349db 100644 --- a/compiler/GHC/Types/Literal.hs +++ b/compiler/GHC/Types/Literal.hs @@ -50,20 +50,20 @@ module GHC.Types.Literal #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Builtin.Types.Prim import GHC.Builtin.Names import GHC.Core.Type import GHC.Core.TyCon -import Outputable -import FastString +import GHC.Utils.Outputable +import GHC.Data.FastString import GHC.Types.Basic -import Binary +import GHC.Utils.Binary import GHC.Settings.Constants import GHC.Platform import GHC.Types.Unique.FM -import Util +import GHC.Utils.Misc import Data.ByteString (ByteString) import Data.Int diff --git a/compiler/GHC/Types/Module.hs b/compiler/GHC/Types/Module.hs index 80ae18684f..76bc026ea3 100644 --- a/compiler/GHC/Types/Module.hs +++ b/compiler/GHC/Types/Module.hs @@ -137,25 +137,25 @@ module GHC.Types.Module unitModuleSet ) where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.DFM import GHC.Types.Unique.DSet -import FastString -import Binary -import Util +import GHC.Data.FastString +import GHC.Utils.Binary +import GHC.Utils.Misc import Data.List (sortBy, sort) import Data.Ord import Data.Version import GHC.PackageDb -import Fingerprint +import GHC.Utils.Fingerprint import qualified Data.ByteString as BS import qualified Data.ByteString.Char8 as BS.Char8 -import Encoding +import GHC.Utils.Encoding import qualified Text.ParserCombinators.ReadP as Parse import Text.ParserCombinators.ReadP (ReadP, (<++)) @@ -168,7 +168,7 @@ import Data.Map (Map) import Data.Set (Set) import qualified Data.Map as Map import qualified Data.Set as Set -import qualified FiniteMap as Map +import qualified GHC.Data.FiniteMap as Map import System.FilePath import {-# SOURCE #-} GHC.Driver.Session (DynFlags) diff --git a/compiler/GHC/Types/Module.hs-boot b/compiler/GHC/Types/Module.hs-boot index 77df64280f..5d30a94f32 100644 --- a/compiler/GHC/Types/Module.hs-boot +++ b/compiler/GHC/Types/Module.hs-boot @@ -1,6 +1,6 @@ module GHC.Types.Module where -import GhcPrelude +import GHC.Prelude data Module data ModuleName diff --git a/compiler/GHC/Types/Name.hs b/compiler/GHC/Types/Name.hs index 60aee23af8..691a198167 100644 --- a/compiler/GHC/Types/Name.hs +++ b/compiler/GHC/Types/Name.hs @@ -79,7 +79,7 @@ module GHC.Types.Name ( module GHC.Types.Name.Occurrence ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.TyCo.Rep( TyThing ) @@ -87,11 +87,11 @@ import GHC.Types.Name.Occurrence import GHC.Types.Module import GHC.Types.SrcLoc import GHC.Types.Unique -import Util -import Maybes -import Binary -import FastString -import Outputable +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Utils.Binary +import GHC.Data.FastString +import GHC.Utils.Outputable import Control.DeepSeq import Data.Data diff --git a/compiler/GHC/Types/Name.hs-boot b/compiler/GHC/Types/Name.hs-boot index fdd2f62b8d..331dbda5ed 100644 --- a/compiler/GHC/Types/Name.hs-boot +++ b/compiler/GHC/Types/Name.hs-boot @@ -1,5 +1,5 @@ module GHC.Types.Name where -import GhcPrelude () +import GHC.Prelude () data Name diff --git a/compiler/GHC/Types/Name/Cache.hs b/compiler/GHC/Types/Name/Cache.hs index 9cac5eadf1..2d81e048ad 100644 --- a/compiler/GHC/Types/Name/Cache.hs +++ b/compiler/GHC/Types/Name/Cache.hs @@ -10,14 +10,14 @@ module GHC.Types.Name.Cache , NameCache(..), OrigNameCache ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Module import GHC.Types.Name import GHC.Types.Unique.Supply import GHC.Builtin.Types -import Util -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Outputable import GHC.Builtin.Names #include "HsVersions.h" diff --git a/compiler/GHC/Types/Name/Env.hs b/compiler/GHC/Types/Name/Env.hs index 25842ab3f1..500c58043d 100644 --- a/compiler/GHC/Types/Name/Env.hs +++ b/compiler/GHC/Types/Name/Env.hs @@ -37,13 +37,13 @@ module GHC.Types.Name.Env ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Digraph +import GHC.Data.Graph.Directed import GHC.Types.Name import GHC.Types.Unique.FM import GHC.Types.Unique.DFM -import Maybes +import GHC.Data.Maybe {- ************************************************************************ @@ -60,7 +60,7 @@ depAnal is deterministic provided it gets the nodes in a deterministic order. The order of lists that get_defs and get_uses return doesn't matter, as these are only used to construct the edges, and stronglyConnCompFromEdgedVertices is deterministic even when the edges are not in deterministic order as explained -in Note [Deterministic SCC] in Digraph. +in Note [Deterministic SCC] in GHC.Data.Graph.Directed. -} depAnal :: forall node. diff --git a/compiler/GHC/Types/Name/Occurrence.hs b/compiler/GHC/Types/Name/Occurrence.hs index c54770be13..4c5ac689f2 100644 --- a/compiler/GHC/Types/Name/Occurrence.hs +++ b/compiler/GHC/Types/Name/Occurrence.hs @@ -101,17 +101,17 @@ module GHC.Types.Name.Occurrence ( FastStringEnv, emptyFsEnv, lookupFsEnv, extendFsEnv, mkFsEnv ) where -import GhcPrelude +import GHC.Prelude -import Util +import GHC.Utils.Misc import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import FastString -import FastStringEnv -import Outputable +import GHC.Data.FastString +import GHC.Data.FastString.Env +import GHC.Utils.Outputable import GHC.Utils.Lexeme -import Binary +import GHC.Utils.Binary import Control.DeepSeq import Data.Char import Data.Data diff --git a/compiler/GHC/Types/Name/Occurrence.hs-boot b/compiler/GHC/Types/Name/Occurrence.hs-boot index 212b58b8e6..ef23bb13fb 100644 --- a/compiler/GHC/Types/Name/Occurrence.hs-boot +++ b/compiler/GHC/Types/Name/Occurrence.hs-boot @@ -1,5 +1,5 @@ module GHC.Types.Name.Occurrence where -import GhcPrelude () +import GHC.Prelude () data OccName diff --git a/compiler/GHC/Types/Name/Reader.hs b/compiler/GHC/Types/Name/Reader.hs index 29c427d5f9..274e3a90ce 100644 --- a/compiler/GHC/Types/Name/Reader.hs +++ b/compiler/GHC/Types/Name/Reader.hs @@ -70,21 +70,21 @@ module GHC.Types.Name.Reader ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Module import GHC.Types.Name import GHC.Types.Avail import GHC.Types.Name.Set -import Maybes +import GHC.Data.Maybe import GHC.Types.SrcLoc as SrcLoc -import FastString +import GHC.Data.FastString import GHC.Types.FieldLabel -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique import GHC.Types.Unique.FM import GHC.Types.Unique.Set -import Util +import GHC.Utils.Misc import GHC.Types.Name.Env import Data.Data diff --git a/compiler/GHC/Types/Name/Set.hs b/compiler/GHC/Types/Name/Set.hs index 04a8f1effa..c011bcbf23 100644 --- a/compiler/GHC/Types/Name/Set.hs +++ b/compiler/GHC/Types/Name/Set.hs @@ -33,10 +33,10 @@ module GHC.Types.Name.Set ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Name -import OrdList +import GHC.Data.OrdList import GHC.Types.Unique.Set import Data.List (sortBy) diff --git a/compiler/GHC/Types/Name/Shape.hs b/compiler/GHC/Types/Name/Shape.hs index be89bf349c..c7bfd98152 100644 --- a/compiler/GHC/Types/Name/Shape.hs +++ b/compiler/GHC/Types/Name/Shape.hs @@ -13,9 +13,9 @@ where #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Types import GHC.Types.Module import GHC.Types.Unique.FM @@ -25,7 +25,7 @@ import GHC.Types.FieldLabel import GHC.Types.Name import GHC.Types.Name.Env import GHC.Tc.Utils.Monad -import Util +import GHC.Utils.Misc import GHC.Iface.Env import Control.Monad diff --git a/compiler/GHC/Types/RepType.hs b/compiler/GHC/Types/RepType.hs index c1bcb314d3..b883fbb05a 100644 --- a/compiler/GHC/Types/RepType.hs +++ b/compiler/GHC/Types/RepType.hs @@ -23,17 +23,17 @@ module GHC.Types.RepType #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic (Arity, RepArity) import GHC.Core.DataCon -import Outputable +import GHC.Utils.Outputable import GHC.Builtin.Names import GHC.Core.Coercion import GHC.Core.TyCon import GHC.Core.TyCo.Rep import GHC.Core.Type -import Util +import GHC.Utils.Misc import GHC.Builtin.Types.Prim import {-# SOURCE #-} GHC.Builtin.Types ( anyTypeOfKind ) diff --git a/compiler/GHC/Types/SrcLoc.hs b/compiler/GHC/Types/SrcLoc.hs index 9211104cb3..d61c942397 100644 --- a/compiler/GHC/Types/SrcLoc.hs +++ b/compiler/GHC/Types/SrcLoc.hs @@ -106,12 +106,12 @@ module GHC.Types.SrcLoc ( ) where -import GhcPrelude +import GHC.Prelude -import Util -import Json -import Outputable -import FastString +import GHC.Utils.Misc +import GHC.Utils.Json +import GHC.Utils.Outputable +import GHC.Data.FastString import Control.DeepSeq import Control.Applicative (liftA2) diff --git a/compiler/GHC/Types/Unique.hs b/compiler/GHC/Types/Unique.hs index 574d630ca1..fba286da3f 100644 --- a/compiler/GHC/Types/Unique.hs +++ b/compiler/GHC/Types/Unique.hs @@ -75,12 +75,12 @@ module GHC.Types.Unique ( #include "HsVersions.h" #include "Unique.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Basic -import FastString -import Outputable -import Util +import GHC.Data.FastString +import GHC.Utils.Outputable +import GHC.Utils.Misc -- just for implementing a fast [0,61) -> Char function import GHC.Exts (indexCharOffAddr#, Char(..), Int(..)) diff --git a/compiler/GHC/Types/Unique/DFM.hs b/compiler/GHC/Types/Unique/DFM.hs index 21e2f8249b..8d79626c19 100644 --- a/compiler/GHC/Types/Unique/DFM.hs +++ b/compiler/GHC/Types/Unique/DFM.hs @@ -61,10 +61,10 @@ module GHC.Types.Unique.DFM ( alwaysUnsafeUfmToUdfm, ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique ( Uniquable(..), Unique, getKey ) -import Outputable +import GHC.Utils.Outputable import qualified Data.IntMap as M import Data.Data diff --git a/compiler/GHC/Types/Unique/DSet.hs b/compiler/GHC/Types/Unique/DSet.hs index 32d32536df..149f40e06f 100644 --- a/compiler/GHC/Types/Unique/DSet.hs +++ b/compiler/GHC/Types/Unique/DSet.hs @@ -37,9 +37,9 @@ module GHC.Types.Unique.DSet ( mapUniqDSet ) where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import GHC.Types.Unique.DFM import GHC.Types.Unique.Set import GHC.Types.Unique diff --git a/compiler/GHC/Types/Unique/FM.hs b/compiler/GHC/Types/Unique/FM.hs index 01ab645783..4dedf468da 100644 --- a/compiler/GHC/Types/Unique/FM.hs +++ b/compiler/GHC/Types/Unique/FM.hs @@ -71,10 +71,10 @@ module GHC.Types.Unique.FM ( pprUniqFM, pprUFM, pprUFMWithKeys, pluralUFM ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique ( Uniquable(..), Unique, getKey ) -import Outputable +import GHC.Utils.Outputable import qualified Data.IntMap as M import qualified Data.IntSet as S diff --git a/compiler/GHC/Types/Unique/Set.hs b/compiler/GHC/Types/Unique/Set.hs index 1c52a66732..24f8a40e9b 100644 --- a/compiler/GHC/Types/Unique/Set.hs +++ b/compiler/GHC/Types/Unique/Set.hs @@ -46,12 +46,12 @@ module GHC.Types.Unique.Set ( nonDetFoldUniqSet_Directly ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique.FM import GHC.Types.Unique import Data.Coerce -import Outputable +import GHC.Utils.Outputable import Data.Data import qualified Data.Semigroup as Semi diff --git a/compiler/GHC/Types/Unique/Supply.hs b/compiler/GHC/Types/Unique/Supply.hs index 403b88917e..bf4e6dd933 100644 --- a/compiler/GHC/Types/Unique/Supply.hs +++ b/compiler/GHC/Types/Unique/Supply.hs @@ -33,14 +33,14 @@ module GHC.Types.Unique.Supply ( initUniqSupply ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Unique -import PlainPanic (panic) +import GHC.Utils.Panic.Plain (panic) import GHC.IO -import MonadUtils +import GHC.Utils.Monad import Control.Monad import Data.Bits import Data.Char diff --git a/compiler/GHC/Types/Var.hs b/compiler/GHC/Types/Var.hs index 0f91cfd08c..1479856fb4 100644 --- a/compiler/GHC/Types/Var.hs +++ b/compiler/GHC/Types/Var.hs @@ -89,7 +89,7 @@ module GHC.Types.Var ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Core.TyCo.Rep( Type, Kind ) import {-# SOURCE #-} GHC.Core.TyCo.Ppr( pprKind ) @@ -100,9 +100,9 @@ import {-# SOURCE #-} GHC.Types.Id.Info( IdDetails, IdInfo, coVarDetails, isCo import GHC.Types.Name hiding (varName) import GHC.Types.Unique ( Uniquable, Unique, getKey, getUnique , mkUniqueGrimily, nonDetCmpUnique ) -import Util -import Binary -import Outputable +import GHC.Utils.Misc +import GHC.Utils.Binary +import GHC.Utils.Outputable import Data.Data diff --git a/compiler/GHC/Types/Var.hs-boot b/compiler/GHC/Types/Var.hs-boot index bf83f8cda6..6ea03efd91 100644 --- a/compiler/GHC/Types/Var.hs-boot +++ b/compiler/GHC/Types/Var.hs-boot @@ -1,12 +1,12 @@ module GHC.Types.Var where -import GhcPrelude () +import GHC.Prelude () -- We compile this module with -XNoImplicitPrelude (for some -- reason), so if there are no imports it does not seem to -- depend on anything. But it does! We must, for example, -- compile GHC.Types in the ghc-prim library first. -- So this otherwise-unnecessary import tells the build system - -- that this module depends on GhcPrelude, which ensures + -- that this module depends on GHC.Prelude, which ensures -- that GHC.Type is built first. data ArgFlag diff --git a/compiler/GHC/Types/Var/Env.hs b/compiler/GHC/Types/Var/Env.hs index fff3dc897d..883d5bbeca 100644 --- a/compiler/GHC/Types/Var/Env.hs +++ b/compiler/GHC/Types/Var/Env.hs @@ -74,7 +74,7 @@ module GHC.Types.Var.Env ( emptyTidyEnv, mkEmptyTidyEnv, delTidyEnvList ) where -import GhcPrelude +import GHC.Prelude import qualified Data.IntMap.Strict as IntMap -- TODO: Move this to UniqFM import GHC.Types.Name.Occurrence @@ -85,9 +85,9 @@ import GHC.Types.Unique.Set import GHC.Types.Unique.FM import GHC.Types.Unique.DFM import GHC.Types.Unique -import Util -import Maybes -import Outputable +import GHC.Utils.Misc +import GHC.Data.Maybe +import GHC.Utils.Outputable {- ************************************************************************ diff --git a/compiler/GHC/Types/Var/Set.hs b/compiler/GHC/Types/Var/Set.hs index 5126988a2c..5f1ea2e6c4 100644 --- a/compiler/GHC/Types/Var/Set.hs +++ b/compiler/GHC/Types/Var/Set.hs @@ -46,7 +46,7 @@ module GHC.Types.Var.Set ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.Types.Var ( Var, TyVar, CoVar, TyCoVar, Id ) import GHC.Types.Unique @@ -55,7 +55,7 @@ import GHC.Types.Unique.Set import GHC.Types.Unique.DSet import GHC.Types.Unique.FM( disjointUFM, pluralUFM, pprUFM ) import GHC.Types.Unique.DFM( disjointUDFM, udfmToUfm, anyUDFM, allUDFM ) -import Outputable (SDoc) +import GHC.Utils.Outputable (SDoc) -- | A non-deterministic Variable Set -- diff --git a/compiler/main/UnitInfo.hs b/compiler/GHC/Unit/Info.hs index 3fda0b79e8..7248d84620 100644 --- a/compiler/main/UnitInfo.hs +++ b/compiler/GHC/Unit/Info.hs @@ -6,7 +6,7 @@ -- -- (c) The University of Glasgow, 2004 -- -module UnitInfo ( +module GHC.Unit.Info ( -- $package_naming -- * UnitId @@ -30,13 +30,13 @@ module UnitInfo ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import GHC.PackageDb import Data.Version -import FastString -import Outputable +import GHC.Data.FastString +import GHC.Utils.Outputable import GHC.Types.Module as Module import GHC.Types.Unique diff --git a/compiler/utils/AsmUtils.hs b/compiler/GHC/Utils/Asm.hs index d3393d71e2..5b8b209f5e 100644 --- a/compiler/utils/AsmUtils.hs +++ b/compiler/GHC/Utils/Asm.hs @@ -2,14 +2,14 @@ -- -- These are used not only by the native code generator, but also by the -- GHC.Driver.Pipeline -module AsmUtils +module GHC.Utils.Asm ( sectionType ) where -import GhcPrelude +import GHC.Prelude import GHC.Platform -import Outputable +import GHC.Utils.Outputable -- | Generate a section type (e.g. @\@progbits@). See #13937. sectionType :: Platform -- ^ Target platform diff --git a/compiler/utils/Binary.hs b/compiler/GHC/Utils/Binary.hs index 529519df1d..1283dd5ffb 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/GHC/Utils/Binary.hs @@ -21,7 +21,7 @@ -- where you can obtain the original version of the Binary library, namely -- http://www.cs.york.ac.uk/fp/nhc98/ -module Binary +module GHC.Utils.Binary ( {-type-} Bin, {-class-} Binary(..), {-type-} BinHandle, @@ -64,14 +64,14 @@ module Binary #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Types.Name (Name) -import FastString -import PlainPanic +import GHC.Data.FastString +import GHC.Utils.Panic.Plain import GHC.Types.Unique.FM -import FastMutInt -import Fingerprint +import GHC.Data.FastMutInt +import GHC.Utils.Fingerprint import GHC.Types.Basic import GHC.Types.SrcLoc @@ -719,7 +719,7 @@ architecture specific details. We still use this scheme even with LEB128 available, as it has less overhead for truly large numbers. (> maxBound :: Int64) -The instance is used for in Binary Integer and Binary Rational in basicTypes/Literal.hs +The instance is used for in Binary Integer and Binary Rational in GHC.Types.Literal -} instance Binary Integer where diff --git a/compiler/utils/BufWrite.hs b/compiler/GHC/Utils/BufHandle.hs index 8a28f470f4..b0b829f96f 100644 --- a/compiler/utils/BufWrite.hs +++ b/compiler/GHC/Utils/BufHandle.hs @@ -8,11 +8,11 @@ -- -- This is a simple abstraction over Handles that offers very fast write -- buffering, but without the thread safety that Handles provide. It's used --- to save time in Pretty.printDoc. +-- to save time in GHC.Utils.Ppr.printDoc. -- ----------------------------------------------------------------------------- -module BufWrite ( +module GHC.Utils.BufHandle ( BufHandle(..), newBufHandle, bPutChar, @@ -24,10 +24,10 @@ module BufWrite ( bFlush, ) where -import GhcPrelude +import GHC.Prelude -import FastString -import FastMutInt +import GHC.Data.FastString +import GHC.Data.FastMutInt import Control.Monad ( when ) import Data.ByteString (ByteString) diff --git a/compiler/main/CliOption.hs b/compiler/GHC/Utils/CliOption.hs index d42c5b4900..9f2333d351 100644 --- a/compiler/main/CliOption.hs +++ b/compiler/GHC/Utils/CliOption.hs @@ -1,9 +1,9 @@ -module CliOption +module GHC.Utils.CliOption ( Option (..) , showOpt ) where -import GhcPrelude +import GHC.Prelude -- ----------------------------------------------------------------------------- -- Command-line options diff --git a/compiler/utils/Encoding.hs b/compiler/GHC/Utils/Encoding.hs index b4af68621d..165aa05e5b 100644 --- a/compiler/utils/Encoding.hs +++ b/compiler/GHC/Utils/Encoding.hs @@ -11,7 +11,7 @@ -- -- ----------------------------------------------------------------------------- -module Encoding ( +module GHC.Utils.Encoding ( -- * UTF-8 utf8DecodeChar#, utf8PrevChar, @@ -33,7 +33,7 @@ module Encoding ( toBase62Padded ) where -import GhcPrelude +import GHC.Prelude import Foreign import Foreign.ForeignPtr.Unsafe diff --git a/compiler/main/ErrUtils.hs b/compiler/GHC/Utils/Error.hs index 2a4168302b..4b3683465a 100644 --- a/compiler/main/ErrUtils.hs +++ b/compiler/GHC/Utils/Error.hs @@ -10,7 +10,7 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE LambdaCase #-} -module ErrUtils ( +module GHC.Utils.Error ( -- * Basic types Validity(..), andValid, allValid, isValid, getInvalids, orValid, Severity(..), @@ -64,18 +64,18 @@ module ErrUtils ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Bag -import Exception -import Outputable -import Panic -import qualified PprColour as Col +import GHC.Data.Bag +import GHC.Utils.Exception +import GHC.Utils.Outputable as Outputable +import GHC.Utils.Panic +import qualified GHC.Utils.Ppr.Colour as Col import GHC.Types.SrcLoc as SrcLoc import GHC.Driver.Session -import FastString (unpackFS) -import StringBuffer (atLine, hGetStringBuffer, len, lexemeToString) -import Json +import GHC.Data.FastString (unpackFS) +import GHC.Data.StringBuffer (atLine, hGetStringBuffer, len, lexemeToString) +import GHC.Utils.Json import System.Directory import System.Exit ( ExitCode(..), exitWith ) diff --git a/compiler/main/ErrUtils.hs-boot b/compiler/GHC/Utils/Error.hs-boot index f7f8b12f80..20c6930fa5 100644 --- a/compiler/main/ErrUtils.hs-boot +++ b/compiler/GHC/Utils/Error.hs-boot @@ -1,11 +1,11 @@ {-# LANGUAGE RankNTypes #-} -module ErrUtils where +module GHC.Utils.Error where -import GhcPrelude -import Outputable (SDoc, PprStyle ) +import GHC.Prelude +import GHC.Utils.Outputable (SDoc, PprStyle ) import GHC.Types.SrcLoc (SrcSpan) -import Json +import GHC.Utils.Json import {-# SOURCE #-} GHC.Driver.Session ( DynFlags ) type DumpAction = DynFlags -> PprStyle -> DumpOptions -> String diff --git a/compiler/utils/Exception.hs b/compiler/GHC/Utils/Exception.hs index 9d9b3ae25c..e84221cdbe 100644 --- a/compiler/utils/Exception.hs +++ b/compiler/GHC/Utils/Exception.hs @@ -1,12 +1,12 @@ {-# OPTIONS_GHC -fno-warn-deprecations #-} -module Exception +module GHC.Utils.Exception ( module Control.Exception, - module Exception + module GHC.Utils.Exception ) where -import GhcPrelude +import GHC.Prelude import Control.Exception import Control.Monad.IO.Class diff --git a/compiler/utils/FV.hs b/compiler/GHC/Utils/FV.hs index f0a35d4100..167cf7fe02 100644 --- a/compiler/utils/FV.hs +++ b/compiler/GHC/Utils/FV.hs @@ -1,13 +1,12 @@ {- (c) Bartosz Nitka, Facebook 2015 -Utilities for efficiently and deterministically computing free variables. - -} {-# LANGUAGE BangPatterns #-} -module FV ( +-- | Utilities for efficiently and deterministically computing free variables. +module GHC.Utils.FV ( -- * Deterministic free vars computations FV, InterestingVarFun, @@ -26,7 +25,7 @@ module FV ( mapUnionFV, ) where -import GhcPrelude +import GHC.Prelude import GHC.Types.Var import GHC.Types.Var.Set diff --git a/compiler/utils/Fingerprint.hs b/compiler/GHC/Utils/Fingerprint.hs index 21f6a93c77..b8c2091135 100644 --- a/compiler/utils/Fingerprint.hs +++ b/compiler/GHC/Utils/Fingerprint.hs @@ -11,7 +11,7 @@ -- -- ---------------------------------------------------------------------------- -module Fingerprint ( +module GHC.Utils.Fingerprint ( readHexFingerprint, fingerprintByteString, -- * Re-exported from GHC.Fingerprint @@ -24,7 +24,7 @@ module Fingerprint ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude import Foreign import GHC.IO diff --git a/compiler/utils/FastFunctions.hs b/compiler/GHC/Utils/IO/Unsafe.hs index 9a09bb7b76..27efe373f7 100644 --- a/compiler/utils/FastFunctions.hs +++ b/compiler/GHC/Utils/IO/Unsafe.hs @@ -4,13 +4,14 @@ {-# LANGUAGE CPP, MagicHash, UnboxedTuples #-} -module FastFunctions ( - inlinePerformIO, - ) where +module GHC.Utils.IO.Unsafe + ( inlinePerformIO, + ) +where #include "HsVersions.h" -import GhcPrelude () +import GHC.Prelude () import GHC.Exts import GHC.IO (IO(..)) diff --git a/compiler/utils/Json.hs b/compiler/GHC/Utils/Json.hs index 2bf00d3851..21358847c0 100644 --- a/compiler/utils/Json.hs +++ b/compiler/GHC/Utils/Json.hs @@ -1,9 +1,9 @@ {-# LANGUAGE GADTs #-} -module Json where +module GHC.Utils.Json where -import GhcPrelude +import GHC.Prelude -import Outputable +import GHC.Utils.Outputable import Data.Char import Numeric diff --git a/compiler/GHC/Utils/Lexeme.hs b/compiler/GHC/Utils/Lexeme.hs index 44bdbf0895..6df962a54b 100644 --- a/compiler/GHC/Utils/Lexeme.hs +++ b/compiler/GHC/Utils/Lexeme.hs @@ -27,9 +27,9 @@ module GHC.Utils.Lexeme ( ) where -import GhcPrelude +import GHC.Prelude -import FastString +import GHC.Data.FastString import Data.Char import qualified Data.Set as Set diff --git a/compiler/utils/Util.hs b/compiler/GHC/Utils/Misc.hs index b343d9cf8b..b191507fca 100644 --- a/compiler/utils/Util.hs +++ b/compiler/GHC/Utils/Misc.hs @@ -10,7 +10,7 @@ -- | Highly random utility functions -- -module Util ( +module GHC.Utils.Misc ( -- * Flags dependent on the compiler build ghciSupported, debugIsOn, isWindowsHost, isDarwinHost, @@ -131,10 +131,10 @@ module Util ( #include "HsVersions.h" -import GhcPrelude +import GHC.Prelude -import Exception -import PlainPanic +import GHC.Utils.Exception +import GHC.Utils.Panic.Plain import Data.Data import Data.IORef ( IORef, newIORef, atomicModifyIORef' ) @@ -166,7 +166,7 @@ import qualified Data.Set as Set import Data.Time #if defined(DEBUG) -import {-# SOURCE #-} Outputable ( warnPprTrace, text ) +import {-# SOURCE #-} GHC.Utils.Outputable ( warnPprTrace, text ) #endif infixr 9 `thenCmp` diff --git a/compiler/utils/MonadUtils.hs b/compiler/GHC/Utils/Monad.hs index 50e53b98c8..9e53edd0bb 100644 --- a/compiler/utils/MonadUtils.hs +++ b/compiler/GHC/Utils/Monad.hs @@ -1,7 +1,7 @@ -- | Utilities related to Monad and Applicative classes -- Mostly for backwards compatibility. -module MonadUtils +module GHC.Utils.Monad ( Applicative(..) , (<$>) @@ -26,7 +26,7 @@ module MonadUtils -- Imports ------------------------------------------------------------------------------- -import GhcPrelude +import GHC.Prelude import Control.Applicative import Control.Monad diff --git a/compiler/utils/State.hs b/compiler/GHC/Utils/Monad/State.hs index 92269e91e7..c7b9e3f591 100644 --- a/compiler/utils/State.hs +++ b/compiler/GHC/Utils/Monad/State.hs @@ -1,9 +1,9 @@ {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE UnboxedTuples #-} -module State where +module GHC.Utils.Monad.State where -import GhcPrelude +import GHC.Prelude newtype State s a = State { runState' :: s -> (# a, s #) } deriving (Functor) diff --git a/compiler/utils/Outputable.hs b/compiler/GHC/Utils/Outputable.hs index d36faa4724..178ac58818 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/GHC/Utils/Outputable.hs @@ -11,7 +11,7 @@ -- The interface to this module is very similar to the standard Hughes-PJ pretty printing -- module, except that it exports a number of additional functions that are rarely used, -- and works over the 'SDoc' type. -module Outputable ( +module GHC.Utils.Outputable ( -- * Type classes Outputable(..), OutputableBndr(..), @@ -92,7 +92,7 @@ module Outputable ( pprDebugAndThen, callStackDoc, ) where -import GhcPrelude +import GHC.Prelude import {-# SOURCE #-} GHC.Driver.Session ( DynFlags, hasPprDebug, hasNoDebugOutput @@ -102,13 +102,13 @@ import {-# SOURCE #-} GHC.Driver.Session import {-# SOURCE #-} GHC.Types.Module( UnitId, Module, ModuleName, moduleName ) import {-# SOURCE #-} GHC.Types.Name.Occurrence( OccName ) -import BufWrite (BufHandle) -import FastString -import qualified Pretty -import Util -import qualified PprColour as Col -import Pretty ( Doc, Mode(..) ) -import Panic +import GHC.Utils.BufHandle (BufHandle) +import GHC.Data.FastString +import qualified GHC.Utils.Ppr as Pretty +import GHC.Utils.Misc +import qualified GHC.Utils.Ppr.Colour as Col +import GHC.Utils.Ppr ( Doc, Mode(..) ) +import GHC.Utils.Panic import GHC.Serialized import GHC.LanguageExtensions (Extension) @@ -135,7 +135,7 @@ import GHC.Fingerprint import GHC.Show ( showMultiLineString ) import GHC.Stack ( callStack, prettyCallStack ) import Control.Monad.IO.Class -import Exception +import GHC.Utils.Exception {- ************************************************************************ @@ -617,7 +617,7 @@ integer n = docToSDoc $ Pretty.integer n float n = docToSDoc $ Pretty.float n double n = docToSDoc $ Pretty.double n rational n = docToSDoc $ Pretty.rational n - -- See Note [Print Hexadecimal Literals] in Pretty.hs + -- See Note [Print Hexadecimal Literals] in GHC.Utils.Ppr word n = sdocOption sdocHexWordLiterals $ \case True -> docToSDoc $ Pretty.hex n False -> docToSDoc $ Pretty.integer n diff --git a/compiler/utils/Outputable.hs-boot b/compiler/GHC/Utils/Outputable.hs-boot index 77e0982826..dee3d2039c 100644 --- a/compiler/utils/Outputable.hs-boot +++ b/compiler/GHC/Utils/Outputable.hs-boot @@ -1,6 +1,6 @@ -module Outputable where +module GHC.Utils.Outputable where -import GhcPrelude +import GHC.Prelude import GHC.Stack( HasCallStack ) data SDoc diff --git a/compiler/utils/Panic.hs b/compiler/GHC/Utils/Panic.hs index 16f493826c..48695e25d4 100644 --- a/compiler/utils/Panic.hs +++ b/compiler/GHC/Utils/Panic.hs @@ -2,19 +2,19 @@ (c) The University of Glasgow 2006 (c) The GRASP Project, Glasgow University, 1992-2000 -Defines basic functions for printing error messages. - -It's hard to put these functions anywhere else without causing -some unnecessary loops in the module dependency graph. -} {-# LANGUAGE CPP, ScopedTypeVariables, LambdaCase #-} -module Panic ( +-- | Defines basic functions for printing error messages. +-- +-- It's hard to put these functions anywhere else without causing +-- some unnecessary loops in the module dependency graph. +module GHC.Utils.Panic ( GhcException(..), showGhcException, throwGhcException, throwGhcExceptionIO, handleGhcException, - PlainPanic.progName, + GHC.Utils.Panic.Plain.progName, pgmError, panic, sorry, assertPanic, trace, @@ -28,12 +28,12 @@ module Panic ( withSignalHandlers, ) where -import GhcPrelude +import GHC.Prelude -import {-# SOURCE #-} Outputable (SDoc, showSDocUnsafe) -import PlainPanic +import {-# SOURCE #-} GHC.Utils.Outputable (SDoc, showSDocUnsafe) +import GHC.Utils.Panic.Plain -import Exception +import GHC.Utils.Exception as Exception import Control.Monad.IO.Class import Control.Concurrent diff --git a/compiler/utils/PlainPanic.hs b/compiler/GHC/Utils/Panic/Plain.hs index 0892ebff7d..37e0574d4b 100644 --- a/compiler/utils/PlainPanic.hs +++ b/compiler/GHC/Utils/Panic/Plain.hs @@ -14,7 +14,7 @@ -- -- 2. To reduce the number of modules that need to be compiled to -- object code when loading GHC into GHCi. See #13101 -module PlainPanic +module GHC.Utils.Panic.Plain ( PlainGhcException(..) , showPlainGhcException @@ -28,9 +28,9 @@ module PlainPanic #include "HsVersions.h" import Config -import Exception +import GHC.Utils.Exception as Exception import GHC.Stack -import GhcPrelude +import GHC.Prelude import System.Environment import System.IO.Unsafe diff --git a/compiler/utils/Pretty.hs b/compiler/GHC/Utils/Ppr.hs index 5adfdd7699..559088e415 100644 --- a/compiler/utils/Pretty.hs +++ b/compiler/GHC/Utils/Ppr.hs @@ -3,7 +3,7 @@ ----------------------------------------------------------------------------- -- | --- Module : Pretty +-- Module : GHC.Utils.Ppr -- Copyright : (c) The University of Glasgow 2001 -- License : BSD-style (see the file LICENSE) -- @@ -63,7 +63,7 @@ allocation in the compiler (see thomie's comments in https://github.com/haskell/pretty/pull/9). -} -module Pretty ( +module GHC.Utils.Ppr ( -- * The document type Doc, TextDetails(..), @@ -111,11 +111,11 @@ module Pretty ( ) where -import GhcPrelude hiding (error) +import GHC.Prelude hiding (error) -import BufWrite -import FastString -import PlainPanic +import GHC.Utils.BufHandle +import GHC.Data.FastString +import GHC.Utils.Panic.Plain import System.IO import Numeric (showHex) diff --git a/compiler/utils/PprColour.hs b/compiler/GHC/Utils/Ppr/Colour.hs index f32b8b0084..7283edd182 100644 --- a/compiler/utils/PprColour.hs +++ b/compiler/GHC/Utils/Ppr/Colour.hs @@ -1,8 +1,8 @@ -module PprColour where -import GhcPrelude +module GHC.Utils.Ppr.Colour where +import GHC.Prelude import Data.Maybe (fromMaybe) -import Util (OverridingBool(..), split) +import GHC.Utils.Misc (OverridingBool(..), split) import Data.Semigroup as Semi -- | A colour\/style for use with 'coloured'. diff --git a/compiler/HsVersions.h b/compiler/HsVersions.h index c46d5c897f..3f9f28df21 100644 --- a/compiler/HsVersions.h +++ b/compiler/HsVersions.h @@ -15,25 +15,25 @@ you will screw up the layout where they are used in case expressions! #define GLOBAL_VAR(name,value,ty) \ {-# NOINLINE name #-}; \ name :: IORef (ty); \ -name = Util.global (value); +name = GHC.Utils.Misc.global (value); #define GLOBAL_VAR_M(name,value,ty) \ {-# NOINLINE name #-}; \ name :: IORef (ty); \ -name = Util.globalM (value); +name = GHC.Utils.Misc.globalM (value); #define SHARED_GLOBAL_VAR(name,accessor,saccessor,value,ty) \ {-# NOINLINE name #-}; \ name :: IORef (ty); \ -name = Util.sharedGlobal (value) (accessor); \ +name = GHC.Utils.Misc.sharedGlobal (value) (accessor); \ foreign import ccall unsafe saccessor \ accessor :: Ptr (IORef a) -> IO (Ptr (IORef a)); #define SHARED_GLOBAL_VAR_M(name,accessor,saccessor,value,ty) \ {-# NOINLINE name #-}; \ name :: IORef (ty); \ -name = Util.sharedGlobalM (value) (accessor); \ +name = GHC.Utils.Misc.sharedGlobalM (value) (accessor); \ foreign import ccall unsafe saccessor \ accessor :: Ptr (IORef a) -> IO (Ptr (IORef a)); diff --git a/compiler/ghc.cabal.in b/compiler/ghc.cabal.in index c1c4b6dc24..5cc0b3af31 100644 --- a/compiler/ghc.cabal.in +++ b/compiler/ghc.cabal.in @@ -136,7 +136,7 @@ Library UnboxedTuples UndecidableInstances - Include-Dirs: . utils + Include-Dirs: . -- We need to set the unit id to ghc (without a version number) -- as it's magic. @@ -160,8 +160,6 @@ Library hs-source-dirs: . - main - utils -- we use an explicit Prelude Default-Extensions: @@ -180,7 +178,7 @@ Library GHC.Types.Name.Shape GHC.Iface.Rename GHC.Types.Avail - AsmUtils + GHC.Utils.Asm GHC.Types.Basic GHC.Core.ConLike GHC.Core.DataCon @@ -188,7 +186,7 @@ Library GHC.Types.Demand GHC.Types.Cpr GHC.Cmm.DebugBlock - Exception + GHC.Utils.Exception GHC.Types.FieldLabel GHC.Driver.Monad GHC.Driver.Hooks @@ -222,11 +220,11 @@ Library GHC.Types.SrcLoc GHC.Types.Unique.Supply GHC.Types.Unique - UpdateCafInfos + GHC.Iface.UpdateCafInfos GHC.Types.Var GHC.Types.Var.Env GHC.Types.Var.Set - UnVarGraph + GHC.Data.Graph.UnVar GHC.Cmm.BlockId GHC.Cmm.CLabel GHC.Cmm @@ -252,8 +250,8 @@ Library GHC.Cmm.Type GHC.Cmm.Utils GHC.Cmm.LayoutStack - CliOption - EnumSet + GHC.Utils.CliOption + GHC.Data.EnumSet GHC.Cmm.Graph GHC.CmmToAsm.Ppr GHC.CmmToAsm.Config @@ -296,7 +294,7 @@ Library GHC.Core.Subst GHC.Core.SimpleOpt GHC.Core - TrieMap + GHC.Data.TrieMap GHC.Core.Tidy GHC.Core.Unfold GHC.Core.Utils @@ -360,26 +358,26 @@ Library GHC.Driver.Pipeline.Monad GHC.Driver.Pipeline GHC.Driver.Session - ErrUtils + GHC.Utils.Error GHC.Driver.Finder GHC GHC.Driver.Make GHC.Plugins - GhcPrelude + GHC.Prelude GHC.Parser.Header GHC.Driver.Main - HscStats + GHC.Hs.Stats GHC.Driver.Types GHC.Runtime.Eval GHC.Runtime.Eval.Types GHC.Runtime.Loader - UnitInfo + GHC.Unit.Info GHC.Driver.Packages GHC.Driver.Plugins GHC.Tc.Plugin GHC.Core.Ppr.TyThing GHC.Settings - StaticPtrTable + GHC.Iface.Tidy.StaticPtrTable GHC.SysTools GHC.SysTools.BaseDir GHC.SysTools.Terminal @@ -523,43 +521,43 @@ Library GHC.Core.TyCo.Ppr GHC.Core.TyCo.Tidy GHC.Core.Unify - Bag - Binary - BooleanFormula - BufWrite - Digraph - Encoding - FastFunctions - FastMutInt - FastString - FastStringEnv - Fingerprint - FiniteMap - FV - GraphBase - GraphColor - GraphOps - GraphPpr - IOEnv - Json - ListSetOps - Maybes - MonadUtils - OrdList - Outputable - Pair - Panic - PlainPanic - PprColour - Pretty - State - Stream - StringBuffer + GHC.Data.Bag + GHC.Utils.Binary + GHC.Data.BooleanFormula + GHC.Utils.BufHandle + GHC.Data.Graph.Directed + GHC.Utils.Encoding + GHC.Utils.IO.Unsafe + GHC.Data.FastMutInt + GHC.Data.FastString + GHC.Data.FastString.Env + GHC.Utils.Fingerprint + GHC.Data.FiniteMap + GHC.Utils.FV + GHC.Data.Graph.Base + GHC.Data.Graph.Color + GHC.Data.Graph.Ops + GHC.Data.Graph.Ppr + GHC.Data.IOEnv + GHC.Utils.Json + GHC.Data.List.SetOps + GHC.Data.Maybe + GHC.Utils.Monad + GHC.Data.OrdList + GHC.Utils.Outputable + GHC.Data.Pair + GHC.Utils.Panic + GHC.Utils.Panic.Plain + GHC.Utils.Ppr.Colour + GHC.Utils.Ppr + GHC.Utils.Monad.State + GHC.Data.Stream + GHC.Data.StringBuffer GHC.Types.Unique.DFM GHC.Types.Unique.DSet GHC.Types.Unique.FM GHC.Types.Unique.Set - Util + GHC.Utils.Misc GHC.Cmm.Dataflow GHC.Cmm.Dataflow.Block GHC.Cmm.Dataflow.Collections diff --git a/compiler/ghc.mk b/compiler/ghc.mk index d86aae9771..e5351b95db 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -76,7 +76,7 @@ compiler/stage$1/build/Config.hs : mk/config.mk mk/project.mk | $$$$(dir $$$$@)/ @echo ' , cStage' >> $$@ @echo ' ) where' >> $$@ @echo >> $$@ - @echo 'import GhcPrelude' >> $$@ + @echo 'import GHC.Prelude' >> $$@ @echo >> $$@ @echo 'import GHC.Version' >> $$@ @echo >> $$@ diff --git a/ghc/GHCi/Leak.hs b/ghc/GHCi/Leak.hs index 5dcd9ab80d..e6a11cb9af 100644 --- a/ghc/GHCi/Leak.hs +++ b/ghc/GHCi/Leak.hs @@ -12,7 +12,7 @@ import GHC import GHC.Ptr (Ptr (..)) import GHCi.Util import GHC.Driver.Types -import Outputable +import GHC.Utils.Outputable import GHC.Platform (target32Bit) import Prelude import System.Mem diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 87826438e3..46fe4fb4a5 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -41,7 +41,7 @@ import GHC.Runtime.Interpreter.Types import GHCi.RemoteTypes import GHCi.BreakArray import GHC.Driver.Session as DynFlags -import ErrUtils hiding (traceCmd) +import GHC.Utils.Error hiding (traceCmd) import GHC.Driver.Finder as Finder import GHC.Driver.Monad ( modifySession ) import qualified GHC @@ -66,24 +66,24 @@ import GHC.Types.Name.Reader as RdrName ( getGRE_NameQualifier_maybes, getRdrNam import GHC.Types.SrcLoc as SrcLoc import qualified GHC.Parser.Lexer as Lexer -import StringBuffer -import Outputable hiding ( printForUser, printForUserPartWay ) +import GHC.Data.StringBuffer +import GHC.Utils.Outputable hiding ( printForUser, printForUserPartWay ) import GHC.Runtime.Loader ( initializePlugins ) -- Other random utilities import GHC.Types.Basic hiding ( isTopLevel ) import Config -import Digraph -import Encoding -import FastString +import GHC.Data.Graph.Directed +import GHC.Utils.Encoding +import GHC.Data.FastString import GHC.Runtime.Linker -import Maybes ( orElse, expectJust ) +import GHC.Data.Maybe ( orElse, expectJust ) import GHC.Types.Name.Set -import Panic hiding ( showException ) -import Util +import GHC.Utils.Panic hiding ( showException ) +import GHC.Utils.Misc import qualified GHC.LanguageExtensions as LangExt -import Bag (unitBag) +import GHC.Data.Bag (unitBag) -- Haskell Libraries import System.Console.Haskeline as Haskeline @@ -112,7 +112,7 @@ import Data.Time.Format ( formatTime, defaultTimeLocale ) import Data.Version ( showVersion ) import Prelude hiding ((<>)) -import Exception hiding (catch) +import GHC.Utils.Exception as Exception hiding (catch) import Foreign hiding (void) import GHC.Stack hiding (SrcLoc(..)) diff --git a/ghc/GHCi/UI/Info.hs b/ghc/GHCi/UI/Info.hs index f5df1edc38..22eb664856 100644 --- a/ghc/GHCi/UI/Info.hs +++ b/ghc/GHCi/UI/Info.hs @@ -34,12 +34,12 @@ import System.Directory import qualified GHC.Core.Utils import GHC.HsToCore import GHC.Driver.Session (HasDynFlags(..)) -import FastString +import GHC.Data.FastString import GHC import GHC.Driver.Monad import GHC.Types.Name import GHC.Types.Name.Set -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Tc.Utils.Zonk import GHC.Types.Var diff --git a/ghc/GHCi/UI/Monad.hs b/ghc/GHCi/UI/Monad.hs index 27e31b6cf6..fb6d673fff 100644 --- a/ghc/GHCi/UI/Monad.hs +++ b/ghc/GHCi/UI/Monad.hs @@ -38,11 +38,11 @@ module GHCi.UI.Monad ( import GHCi.UI.Info (ModInfo) import qualified GHC import GHC.Driver.Monad hiding (liftIO) -import Outputable hiding (printForUser, printForUserPartWay) -import qualified Outputable +import GHC.Utils.Outputable hiding (printForUser, printForUserPartWay) +import qualified GHC.Utils.Outputable as Outputable import GHC.Types.Name.Occurrence import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Driver.Types import GHC.Types.SrcLoc import GHC.Types.Module @@ -52,9 +52,9 @@ import GHC.Runtime.Interpreter import GHCi.RemoteTypes import GHC.Hs (ImportDecl, GhcPs, GhciLStmt, LHsDecl) import GHC.Hs.Utils -import Util +import GHC.Utils.Misc -import Exception hiding (uninterruptibleMask, mask, catch) +import GHC.Utils.Exception hiding (uninterruptibleMask, mask, catch) import Numeric import Data.Array import Data.IORef diff --git a/ghc/GHCi/UI/Tags.hs b/ghc/GHCi/UI/Tags.hs index 155a63bf5a..9f4dfa6e53 100644 --- a/ghc/GHCi/UI/Tags.hs +++ b/ghc/GHCi/UI/Tags.hs @@ -13,17 +13,17 @@ module GHCi.UI.Tags ( createETagsFileCmd ) where -import Exception +import GHC.Utils.Exception import GHC import GHCi.UI.Monad -import Outputable +import GHC.Utils.Outputable -- ToDo: figure out whether we need these, and put something appropriate -- into the GHC API instead import GHC.Types.Name (nameOccName) import GHC.Types.Name.Occurrence (pprOccName) import GHC.Core.ConLike -import MonadUtils +import GHC.Utils.Monad import Control.Monad import Data.Function @@ -31,7 +31,7 @@ import Data.List import Data.Maybe import Data.Ord import GHC.Driver.Phases -import Panic +import GHC.Utils.Panic import Prelude import System.Directory import System.IO diff --git a/ghc/Main.hs b/ghc/Main.hs index 7a356b920a..a4cd897ab4 100644 --- a/ghc/Main.hs +++ b/ghc/Main.hs @@ -53,23 +53,23 @@ import GHC.Driver.Packages ( pprPackages, pprPackagesSimple ) import GHC.Driver.Phases import GHC.Types.Basic ( failed ) import GHC.Driver.Session hiding (WarnReason(..)) -import ErrUtils -import FastString -import Outputable +import GHC.Utils.Error +import GHC.Data.FastString +import GHC.Utils.Outputable as Outputable import GHC.SysTools.BaseDir import GHC.Settings.IO import GHC.Types.SrcLoc -import Util -import Panic +import GHC.Utils.Misc +import GHC.Utils.Panic import GHC.Types.Unique.Supply -import MonadUtils ( liftIO ) +import GHC.Utils.Monad ( liftIO ) -- Imports for --abi-hash -import GHC.Iface.Load ( loadUserInterface ) -import GHC.Driver.Finder ( findImportedModule, cannotFindModule ) -import GHC.Tc.Utils.Monad ( initIfaceCheck ) -import Binary ( openBinMem, put_ ) -import GHC.Iface.Recomp.Binary ( fingerprintBinMem ) +import GHC.Iface.Load ( loadUserInterface ) +import GHC.Driver.Finder ( findImportedModule, cannotFindModule ) +import GHC.Tc.Utils.Monad ( initIfaceCheck ) +import GHC.Utils.Binary ( openBinMem, put_ ) +import GHC.Iface.Recomp.Binary ( fingerprintBinMem ) -- Standard Haskell libraries import System.IO @@ -786,7 +786,7 @@ showInfo dflags = do let sq x = " [" ++ x ++ "\n ]" putStrLn $ sq $ intercalate "\n ," $ map show $ compilerInfo dflags --- TODO use ErrUtils once that is disentangled from all the other GhcMonad stuff? +-- TODO use GHC.Utils.Error once that is disentangled from all the other GhcMonad stuff? showSupportedExtensions :: Maybe String -> IO () showSupportedExtensions m_top_dir = do res <- runExceptT $ do diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 51afdf8724..b332713222 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -355,7 +355,7 @@ generateConfigHs = do , " , cStage" , " ) where" , "" - , "import GhcPrelude" + , "import GHC.Prelude" , "" , "import GHC.Version" , "" diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs index 6070dfcbd5..c8f4ee1c69 100644 --- a/includes/CodeGen.Platform.hs +++ b/includes/CodeGen.Platform.hs @@ -2,7 +2,7 @@ import GHC.Cmm.Expr #if !(defined(MACHREGS_i386) || defined(MACHREGS_x86_64) \ || defined(MACHREGS_sparc) || defined(MACHREGS_powerpc)) -import PlainPanic +import GHC.Utils.Panic.Plain #endif import GHC.Platform.Reg diff --git a/testsuite/tests/annotations/should_run/annrun01.hs b/testsuite/tests/annotations/should_run/annrun01.hs index 4a587afddc..a18f662ebb 100644 --- a/testsuite/tests/annotations/should_run/annrun01.hs +++ b/testsuite/tests/annotations/should_run/annrun01.hs @@ -3,12 +3,12 @@ module Main where import GHC -import MonadUtils ( liftIO ) +import GHC.Utils.Monad ( liftIO ) import Data.Maybe import GHC.Driver.Session ( defaultFatalMessager, defaultFlushOut ) import GHC.Types.Annotations ( AnnTarget(..), CoreAnnTarget ) import GHC.Serialized ( deserializeWithData ) -import Panic +import GHC.Utils.Panic import Config import Annrun01_Help diff --git a/testsuite/tests/callarity/unittest/CallArity1.hs b/testsuite/tests/callarity/unittest/CallArity1.hs index 5a3820fd34..60cb97835f 100644 --- a/testsuite/tests/callarity/unittest/CallArity1.hs +++ b/testsuite/tests/callarity/unittest/CallArity1.hs @@ -8,8 +8,8 @@ import GHC.Core.Opt.CallArity (callArityRHS) import GHC.Types.Id.Make import GHC.SysTools import GHC.Driver.Session -import ErrUtils -import Outputable +import GHC.Utils.Error +import GHC.Utils.Outputable as Outputable import GHC.Builtin.Types import GHC.Types.Literal import GHC @@ -21,7 +21,7 @@ import GHC.Core.Ppr import GHC.Types.Unique import GHC.Types.Unique.Set import GHC.Core.Lint -import FastString +import GHC.Data.FastString -- Build IDs. use mkTemplateLocal, more predictable than proper uniques go, go2, x, d, n, y, z, scrutf, scruta :: Id diff --git a/testsuite/tests/concurrent/prog001/Arithmetic.hs b/testsuite/tests/concurrent/prog001/Arithmetic.hs index bce3ff6400..183b66c0ed 100644 --- a/testsuite/tests/concurrent/prog001/Arithmetic.hs +++ b/testsuite/tests/concurrent/prog001/Arithmetic.hs @@ -5,7 +5,7 @@ import Control.Concurrent.MVar import System.IO.Unsafe import Utilities import Converter -import Stream +import GHC.Data.Stream import Data.Ratio import Trit diff --git a/testsuite/tests/concurrent/prog001/Converter.hs b/testsuite/tests/concurrent/prog001/Converter.hs index cba86e0cfd..ba4132dc43 100644 --- a/testsuite/tests/concurrent/prog001/Converter.hs +++ b/testsuite/tests/concurrent/prog001/Converter.hs @@ -1,7 +1,7 @@ module Converter (rationalToGray, grayToSignIO, signToGray, Gray, startF, startC) where -import Stream +import GHC.Data.Stream import Data.Ratio import Control.Concurrent import Control.Concurrent.MVar diff --git a/testsuite/tests/concurrent/prog001/Thread.hs b/testsuite/tests/concurrent/prog001/Thread.hs index 12886a8456..18799607a1 100644 --- a/testsuite/tests/concurrent/prog001/Thread.hs +++ b/testsuite/tests/concurrent/prog001/Thread.hs @@ -3,7 +3,7 @@ module Thread (threadTesting1) where import Control.Concurrent import Control.Concurrent.MVar -import Stream +import GHC.Data.Stream import Converter threadTesting1 :: Gray -> Gray -> IO Int diff --git a/testsuite/tests/concurrent/prog001/Trit.hs b/testsuite/tests/concurrent/prog001/Trit.hs index 8674d6510b..f81bc8bf21 100644 --- a/testsuite/tests/concurrent/prog001/Trit.hs +++ b/testsuite/tests/concurrent/prog001/Trit.hs @@ -2,7 +2,7 @@ module Trit (Trit, rationalToTrit, getIntegral, getFraction, getFraction', neg, addTrits, subTrits, shiftLeft, shiftRight, multiply ) where -import Stream +import GHC.Data.Stream import Utilities import Data.Ratio diff --git a/testsuite/tests/concurrent/prog001/Utilities.hs b/testsuite/tests/concurrent/prog001/Utilities.hs index 0ebdb3db9c..faa15d8f8c 100644 --- a/testsuite/tests/concurrent/prog001/Utilities.hs +++ b/testsuite/tests/concurrent/prog001/Utilities.hs @@ -1,6 +1,6 @@ module Utilities (toBinary, fl) where -import Stream +import GHC.Data.Stream import Data.Ratio -- Convert from an Integer to its signed-digit representation diff --git a/testsuite/tests/determinism/determ001/determinism001.hs b/testsuite/tests/determinism/determ001/determinism001.hs index 6de1e673d0..283beaf098 100644 --- a/testsuite/tests/determinism/determ001/determinism001.hs +++ b/testsuite/tests/determinism/determ001/determinism001.hs @@ -1,6 +1,6 @@ module Main where -import Digraph +import GHC.Data.Graph.Directed main = mapM_ print [ test001 diff --git a/testsuite/tests/ghc-api/T10942.hs b/testsuite/tests/ghc-api/T10942.hs index 3598751676..a6cee0fd7f 100644 --- a/testsuite/tests/ghc-api/T10942.hs +++ b/testsuite/tests/ghc-api/T10942.hs @@ -6,8 +6,8 @@ import GHC import Control.Monad.IO.Class (liftIO) import System.Environment import GHC.Parser.Header -import Outputable -import StringBuffer +import GHC.Utils.Outputable +import GHC.Data.StringBuffer main :: IO () main = do diff --git a/testsuite/tests/ghc-api/T11579.hs b/testsuite/tests/ghc-api/T11579.hs index 9e45410d2e..7ea08c9216 100644 --- a/testsuite/tests/ghc-api/T11579.hs +++ b/testsuite/tests/ghc-api/T11579.hs @@ -1,8 +1,8 @@ import System.Environment import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC -import StringBuffer +import GHC.Data.StringBuffer import GHC.Parser.Lexer import GHC.Types.SrcLoc diff --git a/testsuite/tests/ghc-api/T4891/T4891.hs b/testsuite/tests/ghc-api/T4891/T4891.hs index 9c897f7e10..4da3acba18 100644 --- a/testsuite/tests/ghc-api/T4891/T4891.hs +++ b/testsuite/tests/ghc-api/T4891/T4891.hs @@ -19,8 +19,8 @@ import GHC.Types.Name (getOccString) import Unsafe.Coerce import Control.Monad import Data.Maybe -import Bag -import Outputable +import GHC.Data.Bag +import GHC.Utils.Outputable import GHC.Driver.Monad import X diff --git a/testsuite/tests/ghc-api/T6145.hs b/testsuite/tests/ghc-api/T6145.hs index 56538e11d6..7c56320ff3 100644 --- a/testsuite/tests/ghc-api/T6145.hs +++ b/testsuite/tests/ghc-api/T6145.hs @@ -6,9 +6,9 @@ module Main where import System.IO import GHC -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) diff --git a/testsuite/tests/ghc-api/T7478/T7478.hs b/testsuite/tests/ghc-api/T7478/T7478.hs index 4aa6f7d29e..ae8bb82e88 100644 --- a/testsuite/tests/ghc-api/T7478/T7478.hs +++ b/testsuite/tests/ghc-api/T7478/T7478.hs @@ -7,9 +7,9 @@ import System.Environment import GHC import qualified Config as GHC -import qualified Outputable as GHC +import qualified GHC.Utils.Outputable as GHC import GHC.Driver.Monad (liftIO) -import Outputable (PprStyle, queryQual) +import GHC.Utils.Outputable (PprStyle, queryQual) compileInGhc :: [FilePath] -- ^ Targets -> (String -> IO ()) -- ^ handler for each SevOutput message diff --git a/testsuite/tests/ghc-api/T8628.hs b/testsuite/tests/ghc-api/T8628.hs index a7cbdaa07c..9e8fd84fcb 100644 --- a/testsuite/tests/ghc-api/T8628.hs +++ b/testsuite/tests/ghc-api/T8628.hs @@ -3,12 +3,12 @@ module Main where import System.IO import GHC.Driver.Session import GHC -import Exception +import GHC.Utils.Exception import GHC.Types.Module -import FastString -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Data.FastString +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import GHC.Builtin.Names diff --git a/testsuite/tests/ghc-api/T8639_api.hs b/testsuite/tests/ghc-api/T8639_api.hs index eab7ff9146..48024f6726 100644 --- a/testsuite/tests/ghc-api/T8639_api.hs +++ b/testsuite/tests/ghc-api/T8639_api.hs @@ -2,7 +2,7 @@ module Main where import GHC import GHC.Driver.Monad -import Outputable +import GHC.Utils.Outputable import System.IO import System.Environment( getArgs ) diff --git a/testsuite/tests/ghc-api/T9595.hs b/testsuite/tests/ghc-api/T9595.hs index 808fd8e79c..0080ae9bc5 100644 --- a/testsuite/tests/ghc-api/T9595.hs +++ b/testsuite/tests/ghc-api/T9595.hs @@ -3,7 +3,7 @@ module Main where import GHC import GHC.Driver.Packages import GHC.Driver.Monad -import Outputable +import GHC.Utils.Outputable import System.Environment import GHC.Driver.Session import GHC.Types.Module @@ -14,7 +14,7 @@ main = dflags <- getSessionDynFlags setSessionDynFlags dflags dflags <- getSessionDynFlags - liftIO $ print (mkModuleName "Outputable" `elem` listVisibleModuleNames dflags) + liftIO $ print (mkModuleName "GHC.Utils.Outputable" `elem` listVisibleModuleNames dflags) _ <- runGhc (Just libdir) $ do dflags <- getSessionDynFlags setSessionDynFlags (dflags { @@ -23,5 +23,5 @@ main = (ModRenaming True [])] }) dflags <- getSessionDynFlags - liftIO $ print (mkModuleName "Outputable" `elem` listVisibleModuleNames dflags) + liftIO $ print (mkModuleName "GHC.Utils.Outputable" `elem` listVisibleModuleNames dflags) return () diff --git a/testsuite/tests/ghc-api/annotations-literals/literals.hs b/testsuite/tests/ghc-api/annotations-literals/literals.hs index c125ea6e43..64c0311c07 100644 --- a/testsuite/tests/ghc-api/annotations-literals/literals.hs +++ b/testsuite/tests/ghc-api/annotations-literals/literals.hs @@ -8,9 +8,9 @@ import Data.List (intercalate) import System.IO import GHC import GHC.Driver.Session -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations-literals/parsed.hs b/testsuite/tests/ghc-api/annotations-literals/parsed.hs index 56add861ad..620bf0451e 100644 --- a/testsuite/tests/ghc-api/annotations-literals/parsed.hs +++ b/testsuite/tests/ghc-api/annotations-literals/parsed.hs @@ -9,9 +9,9 @@ import Data.List (intercalate) import System.IO import GHC import GHC.Driver.Session -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/CheckUtils.hs b/testsuite/tests/ghc-api/annotations/CheckUtils.hs index 275067ac8a..3f79f48e28 100644 --- a/testsuite/tests/ghc-api/annotations/CheckUtils.hs +++ b/testsuite/tests/ghc-api/annotations/CheckUtils.hs @@ -10,10 +10,10 @@ import System.IO import GHC import GHC.Types.Basic import GHC.Driver.Session -import MonadUtils -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Parser.Annotation -import Bag (filterBag,isEmptyBag) +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/annotations.hs b/testsuite/tests/ghc-api/annotations/annotations.hs index d9157511aa..8347b57ffc 100644 --- a/testsuite/tests/ghc-api/annotations/annotations.hs +++ b/testsuite/tests/ghc-api/annotations/annotations.hs @@ -10,9 +10,9 @@ import Data.List (intercalate) import System.IO import GHC import GHC.Driver.Session -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/comments.hs b/testsuite/tests/ghc-api/annotations/comments.hs index 60d30426b1..4da8cbda54 100644 --- a/testsuite/tests/ghc-api/annotations/comments.hs +++ b/testsuite/tests/ghc-api/annotations/comments.hs @@ -10,9 +10,9 @@ import Data.List (intercalate) import System.IO import GHC import GHC.Driver.Session -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/listcomps.hs b/testsuite/tests/ghc-api/annotations/listcomps.hs index cd5eb86927..ddc0b7ec7f 100644 --- a/testsuite/tests/ghc-api/annotations/listcomps.hs +++ b/testsuite/tests/ghc-api/annotations/listcomps.hs @@ -11,10 +11,10 @@ import System.IO import GHC import GHC.Types.Basic import GHC.Driver.Session -import MonadUtils -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Parser.Annotation -import Bag (filterBag,isEmptyBag) +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import System.Exit diff --git a/testsuite/tests/ghc-api/annotations/parseTree.hs b/testsuite/tests/ghc-api/annotations/parseTree.hs index af2aeb6cb5..9c167787be 100644 --- a/testsuite/tests/ghc-api/annotations/parseTree.hs +++ b/testsuite/tests/ghc-api/annotations/parseTree.hs @@ -11,9 +11,9 @@ import System.IO import GHC import GHC.Types.Basic import GHC.Driver.Session -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/stringSource.hs b/testsuite/tests/ghc-api/annotations/stringSource.hs index b3b4c85cca..776aebd048 100644 --- a/testsuite/tests/ghc-api/annotations/stringSource.hs +++ b/testsuite/tests/ghc-api/annotations/stringSource.hs @@ -13,12 +13,12 @@ import System.IO import GHC import GHC.Types.Basic import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import MonadUtils -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Hs.Decls -import Bag (filterBag,isEmptyBag) +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/annotations/t11430.hs b/testsuite/tests/ghc-api/annotations/t11430.hs index aa51c4118e..d8be3d1043 100644 --- a/testsuite/tests/ghc-api/annotations/t11430.hs +++ b/testsuite/tests/ghc-api/annotations/t11430.hs @@ -13,12 +13,12 @@ import System.IO import GHC import GHC.Types.Basic import GHC.Driver.Session -import FastString +import GHC.Data.FastString import GHC.Types.ForeignCall -import MonadUtils -import Outputable +import GHC.Utils.Monad +import GHC.Utils.Outputable import GHC.Hs.Decls -import Bag (filterBag,isEmptyBag) +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) import qualified Data.Map as Map diff --git a/testsuite/tests/ghc-api/apirecomp001/myghc.hs b/testsuite/tests/ghc-api/apirecomp001/myghc.hs index 8c6f7b867b..0b65d5add6 100644 --- a/testsuite/tests/ghc-api/apirecomp001/myghc.hs +++ b/testsuite/tests/ghc-api/apirecomp001/myghc.hs @@ -11,9 +11,9 @@ module Main where import GHC import GHC.Driver.Session -import MonadUtils ( MonadIO(..) ) +import GHC.Utils.Monad ( MonadIO(..) ) import GHC.Types.Basic ( failed ) -import Bag ( bagToList ) +import GHC.Data.Bag ( bagToList ) import System.Environment import Control.Monad import System.IO diff --git a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs index df6a2b63f6..b0c6ce2761 100644 --- a/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs +++ b/testsuite/tests/ghc-api/downsweep/PartialDownsweep.hs @@ -6,9 +6,9 @@ import GHC import GHC.Driver.Make import GHC.Driver.Session -import Outputable -import Exception (ExceptionMonad, ghandle) -import Bag +import GHC.Utils.Outputable +import GHC.Utils.Exception (ExceptionMonad, ghandle) +import GHC.Data.Bag import Control.Monad import Control.Monad.IO.Class (liftIO) diff --git a/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs index 9cdd3f0b7d..dd2b6383e2 100644 --- a/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs +++ b/testsuite/tests/ghc-api/dynCompileExpr/dynCompileExpr.hs @@ -2,7 +2,7 @@ module Main where import GHC -import MonadUtils +import GHC.Utils.Monad import System.Environment diff --git a/testsuite/tests/ghc-api/show-srcspan/showsrcspan.hs b/testsuite/tests/ghc-api/show-srcspan/showsrcspan.hs index 9a2993f7a8..01b0bc1a8f 100644 --- a/testsuite/tests/ghc-api/show-srcspan/showsrcspan.hs +++ b/testsuite/tests/ghc-api/show-srcspan/showsrcspan.hs @@ -3,11 +3,11 @@ module Main where import Data.Data import System.IO import GHC -import FastString +import GHC.Data.FastString import GHC.Types.SrcLoc -import MonadUtils -import Outputable -import Bag (filterBag,isEmptyBag) +import GHC.Utils.Monad +import GHC.Utils.Outputable +import GHC.Data.Bag (filterBag,isEmptyBag) import System.Directory (removeFile) import System.Environment( getArgs ) diff --git a/testsuite/tests/ghc-api/target-contents/TargetContents.hs b/testsuite/tests/ghc-api/target-contents/TargetContents.hs index f71d1131e3..a5ef99105f 100644 --- a/testsuite/tests/ghc-api/target-contents/TargetContents.hs +++ b/testsuite/tests/ghc-api/target-contents/TargetContents.hs @@ -11,11 +11,11 @@ import Data.List (intercalate) import Data.Maybe import Data.Time.Calendar import Data.Time.Clock -import Exception +import GHC.Utils.Exception import GHC.Parser.Header import GHC.Driver.Types -import Outputable -import StringBuffer +import GHC.Utils.Outputable +import GHC.Data.StringBuffer import System.Directory import System.Environment import System.Process diff --git a/testsuite/tests/ghci/linking/dyn/T3372.hs b/testsuite/tests/ghci/linking/dyn/T3372.hs index 49b71488c2..3234ff9cdf 100644 --- a/testsuite/tests/ghci/linking/dyn/T3372.hs +++ b/testsuite/tests/ghci/linking/dyn/T3372.hs @@ -11,7 +11,7 @@ import Control.Concurrent.Chan import GHC ( Ghc ) import qualified GHC -import qualified MonadUtils as GHC +import qualified GHC.Utils.Monad as GHC import qualified GHC.Exts diff --git a/testsuite/tests/parser/should_run/CountParserDeps.hs b/testsuite/tests/parser/should_run/CountParserDeps.hs index 03313fb66f..c0b1445dc6 100644 --- a/testsuite/tests/parser/should_run/CountParserDeps.hs +++ b/testsuite/tests/parser/should_run/CountParserDeps.hs @@ -15,7 +15,7 @@ import GHC.Types.Module import GHC.Driver.Session import GHC.Driver.Main import GHC -import Util +import GHC.Utils.Misc import Data.Maybe import Control.Monad import Control.Monad.IO.Class diff --git a/testsuite/tests/parser/unicode/T6016.hs b/testsuite/tests/parser/unicode/T6016.hs index 5783a72843..60a8b206a7 100644 --- a/testsuite/tests/parser/unicode/T6016.hs +++ b/testsuite/tests/parser/unicode/T6016.hs @@ -4,7 +4,7 @@ import Control.Exception import Data.Char import System.IO -import StringBuffer +import GHC.Data.StringBuffer twoBOMs = "T6016-twoBOMs" diff --git a/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs index f3ba8ff8df..45a0205eb0 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/Plugin.hs @@ -4,7 +4,7 @@ module Simple.Plugin(plugin) where import GHC.Types.Unique.FM import GHC.Plugins -import qualified ErrUtils +import qualified GHC.Utils.Error -- For annotation tests import Simple.DataStructures diff --git a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs index 8ee017e61b..610a0c188e 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/RemovePlugin.hs @@ -4,12 +4,12 @@ module Simple.RemovePlugin where import Control.Monad.IO.Class import Data.List (intercalate) import GHC.Driver.Plugins -import Bag +import GHC.Data.Bag import GHC.Driver.Types import GHC.Tc.Types import GHC.Hs.Extension import GHC.Hs.Expr -import Outputable +import GHC.Utils.Outputable import GHC.Types.SrcLoc import GHC.Hs import GHC.Hs.Binds diff --git a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs index 36ea230281..4e0eec36c0 100644 --- a/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs +++ b/testsuite/tests/plugins/simple-plugin/Simple/SourcePlugin.hs @@ -9,7 +9,7 @@ import GHC.Tc.Types import GHC.Hs.Extension import GHC.Types.Avail import GHC.Hs.Expr -import Outputable +import GHC.Utils.Outputable import GHC.Hs.ImpExp import GHC.Hs.Decls import GHC.Hs.Doc diff --git a/testsuite/tests/plugins/static-plugins.hs b/testsuite/tests/plugins/static-plugins.hs index 77a5280bef..47cbb462a2 100644 --- a/testsuite/tests/plugins/static-plugins.hs +++ b/testsuite/tests/plugins/static-plugins.hs @@ -12,7 +12,7 @@ import GHC.Hs.Expr import GHC.Hs.Extension import GHC.Hs.ImpExp import GHC.Driver.Types -import Outputable +import GHC.Utils.Outputable import GHC.Driver.Plugins import System.Environment import GHC.Tc.Types diff --git a/testsuite/tests/pmcheck/should_compile/T11195.hs b/testsuite/tests/pmcheck/should_compile/T11195.hs index 57e2b44276..dca79500ac 100644 --- a/testsuite/tests/pmcheck/should_compile/T11195.hs +++ b/testsuite/tests/pmcheck/should_compile/T11195.hs @@ -10,7 +10,7 @@ import GHC.Core.Coercion.Axiom import GHC.Tc.Utils.TcType ( exactTyCoVarsOfType ) import GHC.Types.Var.Set import GHC.Types.Var.Env -import Pair +import GHC.Data.Pair type NormalCo = Coercion type NormalNonIdCo = NormalCo -- Extra invariant: not the identity diff --git a/testsuite/tests/quasiquotation/T7918.hs b/testsuite/tests/quasiquotation/T7918.hs index d322a7f11e..1a7de12d42 100644 --- a/testsuite/tests/quasiquotation/T7918.hs +++ b/testsuite/tests/quasiquotation/T7918.hs @@ -3,8 +3,8 @@ module Main (main) where import GHC import GHC.Driver.Session -import Outputable -import MonadUtils +import GHC.Utils.Outputable +import GHC.Utils.Monad import GHC.Types.Name.Set import GHC.Types.Var import GHC.Types.SrcLoc as SrcLoc diff --git a/testsuite/tests/regalloc/regalloc_unit_tests.hs b/testsuite/tests/regalloc/regalloc_unit_tests.hs index efe955414c..932d98b5c8 100644 --- a/testsuite/tests/regalloc/regalloc_unit_tests.hs +++ b/testsuite/tests/regalloc/regalloc_unit_tests.hs @@ -40,11 +40,11 @@ import GHC.Driver.Monad import GHC.Types.Unique.FM import GHC.Types.Unique.Supply import GHC.Driver.Session -import ErrUtils -import Outputable +import GHC.Utils.Error +import GHC.Utils.Outputable import GHC.Types.Basic -import Stream (collect, yield) +import GHC.Data.Stream as Stream (collect, yield) import Data.Typeable import Data.Maybe diff --git a/testsuite/tests/rts/linker/LinkerUnload.hs b/testsuite/tests/rts/linker/LinkerUnload.hs index d534be795d..af71cadfac 100644 --- a/testsuite/tests/rts/linker/LinkerUnload.hs +++ b/testsuite/tests/rts/linker/LinkerUnload.hs @@ -4,7 +4,7 @@ import GHC import GHC.Driver.Session import GHC.Runtime.Linker as Linker import System.Environment -import MonadUtils ( MonadIO(..) ) +import GHC.Utils.Monad ( MonadIO(..) ) foreign export ccall loadPackages :: IO () diff --git a/testsuite/tests/rts/linker/rdynamic.hs b/testsuite/tests/rts/linker/rdynamic.hs index bbbe9e898d..d36360745a 100644 --- a/testsuite/tests/rts/linker/rdynamic.hs +++ b/testsuite/tests/rts/linker/rdynamic.hs @@ -12,7 +12,7 @@ import Foreign.C.String ( withCString, CString ) import GHC.Exts ( addrToAny# ) import GHC.Ptr ( Ptr(..), nullPtr ) import System.Info ( os, arch ) -import Encoding +import GHC.Utils.Encoding main = (loadFunction Nothing "Main" "f" :: IO (Maybe String)) >>= print diff --git a/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs b/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs index 8d5c7756d9..e9cd3f34f4 100644 --- a/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs +++ b/testsuite/tests/unboxedsums/unboxedsums_unit_tests.hs @@ -3,7 +3,7 @@ module Main where import GHC.Types.Basic import GHC import GHC.Driver.Monad -import Outputable +import GHC.Utils.Outputable import GHC.Types.RepType import GHC.Builtin.Types.Prim import GHC.Builtin.Types diff --git a/testsuite/tests/utils/should_run/T14854.hs b/testsuite/tests/utils/should_run/T14854.hs index 9187639d6d..ce6ac4b024 100644 --- a/testsuite/tests/utils/should_run/T14854.hs +++ b/testsuite/tests/utils/should_run/T14854.hs @@ -1,7 +1,7 @@ {-# LANGUAGE RecordWildCards #-} module Main (main) where -import FastString +import GHC.Data.FastString import Control.Concurrent import Control.DeepSeq diff --git a/utils/check-api-annotations/Main.hs b/utils/check-api-annotations/Main.hs index e0d62e6684..366f7c7601 100644 --- a/utils/check-api-annotations/Main.hs +++ b/utils/check-api-annotations/Main.hs @@ -4,7 +4,7 @@ import Data.Data import Data.List import GHC import GHC.Driver.Session -import Outputable +import GHC.Utils.Outputable import GHC.Parser.Annotation import GHC.Types.SrcLoc import System.Environment( getArgs ) diff --git a/utils/check-ppr/Main.hs b/utils/check-ppr/Main.hs index 0119311531..b222b726fb 100644 --- a/utils/check-ppr/Main.hs +++ b/utils/check-ppr/Main.hs @@ -5,7 +5,7 @@ import GHC.Types.SrcLoc import GHC hiding (moduleName) import GHC.Hs.Dump import GHC.Driver.Session -import Outputable hiding (space) +import GHC.Utils.Outputable hiding (space) import System.Environment( getArgs ) import System.Exit import System.FilePath diff --git a/utils/haddock b/utils/haddock -Subproject da4e2bd788b6231494d6ac56a8e88bcfa4be51f +Subproject 2d2587182568cc5aa4b29d401517337c32459c6 |