Hierarchical Module Structure for GHC
The aim is to introduce a module hierarchy for GHC. Currently GHC modules don't even have a "GHC." prefix.
-
ghc-api-compat
package can be used to build code against HEAD using old module names: https://github.com/hsyl20/ghc-api-compat/
Motivation
- cleaner code base and overall code structure easier to grasp (no more short cryptic module names)
- better integration with other packages when using GHC API
- better haddocks documentation
Drawbacks
- break the GHC (plugin) API
- may make "rebase" harder during the transition period
Proposed renaming
GHC.Hs
GHC.Hs.Binds <= hsSyn/HsBinds.hs
GHC.Hs.Decls <= hsSyn/HsDecls.hs
GHC.Hs.Doc <= hsSyn/HsDoc.hs
GHC.Hs.Dump <= hsSyn/HsDumpAst.hs
GHC.Hs.Expr <= hsSyn/HsExpr.hs
GHC.Hs.Extension <= hsSyn/HsExtension.hs
GHC.Hs <= hsSyn/HsSyn.hs
GHC.Hs.ImpExp <= hsSyn/HsImpExp.hs
GHC.Hs.Instances <= hsSyn/HsInstances.hs
GHC.Hs.Lit <= hsSyn/HsLit.hs
GHC.Hs.Pat <= hsSyn/HsPat.hs
GHC.Hs.PlaceHolder <= hsSyn/PlaceHolder.hs
GHC.Hs.Type <= hsSyn/HsTypes.hs
GHC.Hs.Utils <= hsSyn/HsUtils.hs
GHC.Hs.Stats <= main/HscStats.hs
GHC.Platform
GHC.Platform.ARM64 <= codeGen/CodeGen/Platform/ARM64.hs
GHC.Platform.ARM <= codeGen/CodeGen/Platform/ARM.hs
GHC.Platform.NoRegs <= codeGen/CodeGen/Platform/NoRegs.hs
GHC.Platform.PPC <= codeGen/CodeGen/Platform/PPC.hs
GHC.Platform.Regs <= codeGen/CodeGen/Platform.hs
GHC.Platform.SPARC <= codeGen/CodeGen/Platform/SPARC.hs
GHC.Platform.X86_64 <= codeGen/CodeGen/Platform/X86_64.hs
GHC.Platform.X86 <= codeGen/CodeGen/Platform/X86.hs
GHC.StgToCmm
GHC.StgToCmm.ArgRep <= codeGen/StgCmmArgRep.hs
GHC.StgToCmm.Bind <= codeGen/StgCmmBind.hs
GHC.StgToCmm.CgUtils <= codeGen/CgUtils.hs
GHC.StgToCmm.Closure <= codeGen/StgCmmClosure.hs
GHC.StgToCmm.DataCon <= codeGen/StgCmmCon.hs
GHC.StgToCmm.Env <= codeGen/StgCmmEnv.hs
GHC.StgToCmm.Expr <= codeGen/StgCmmExpr.hs
GHC.StgToCmm.ExtCode <= codeGen/StgCmmExtCode.hs
GHC.StgToCmm.Foreign <= codeGen/StgCmmForeign.hs
GHC.StgToCmm.Heap <= codeGen/StgCmmHeap.hs
GHC.StgToCmm.Hpc <= codeGen/StgCmmHpc.hs
GHC.StgToCmm <= codeGen/StgCmm.hs
GHC.StgToCmm.Layout <= codeGen/StgCmmLayout.hs
GHC.StgToCmm.Monad <= codeGen/StgCmmMonad.hs
GHC.StgToCmm.Prim <= codeGen/StgCmmPrim.hs
GHC.StgToCmm.Prof <= codeGen/StgCmmProf.hs
GHC.StgToCmm.Ticky <= codeGen/StgCmmTicky.hs
GHC.StgToCmm.Utils <= codeGen/StgCmmUtils.hs
GHC.ThToHs
GHC.ThToHs <= hsSync/Convert.hs
- Renamer:
GHC.Rename.Bind <= rename/RnBinds.hs
GHC.Rename.Env <= rename/RnEnv.hs
GHC.Rename.Expr <= rename/RnExpr.hs
GHC.Rename.Fixity <= rename/RnFixity.hs
GHC.Rename.Doc <= rename/RnHsDoc.hs
GHC.Rename.Names <= rename/RnNames.hs
GHC.Rename.Pat <= rename/RnPat.hs
GHC.Rename.Module <= rename/RnSource.hs
GHC.Rename.Splice <= rename/RnSplice.hs
GHC.Rename.HsType <= rename/RnTypes.hs
GHC.Rename.Unbound <= rename/RnUnbound.hs
GHC.Rename.Utils <= rename/RnUtils.hs
-
GHC.Core
:
GHC.Core.FVs <= coreSyn/CoreFVs.hs
GHC.Core.Map <= coreSyn/CoreMap.hs
GHC.Core.SimpleOpt <= coreSyn/CoreOpt.hs
GHC.Core.Seq <= coreSyn/CoreSeq.hs
GHC.Core.Stats <= coreSyn/CoreStats.hs
GHC.Core.Subst <= coreSyn/CoreSubst.hs
GHC.Core <= coreSyn/CoreSyn.hs
GHC.Core.Unfold <= coreSyn/CoreUnfold.hs
GHC.Core.Utils <= coreSyn/CoreUtils.hs
GHC.Core.Make <= coreSyn/MkCore.hs
GHC.Core.Ppr <= coreSyn/PprCore.hs
GHC.Core.Ppr.TyThing <= main/PprTyThing.hs
GHC.Core.Rules <= specialise/Rules.hs
GHC.Core.Lint <= coreSyn/CoreLint.hs
GHC.Core.Tidy <= coreSyn/CoreTidy.hs
GHC.Core.Class <= types/Class.hs
GHC.Core.Coercion <= types/Coercion.hs
GHC.Core.ConLike <= basicTypes/ConLike.hs
GHC.Core.FamInstEnv <= types/FamInstEnv.hs
GHC.Core.InstEnv <= types/InstEnv.hs
GHC.Core.TyCon <= types/TyCon.hs
GHC.Core.Type <= types/Type.hs
GHC.Core.Unify <= types/Unify.hs
GHC.Core.DataCon <= basicTypes/DataCon.hs
GHC.Core.PatSyn <= basicTypes/PatSyn.hs
GHC.Core.Predicate <= basicTypes/Predicate.hs
GHC.Core.TyCo.FVs <= types/TyCoFVs.hs
GHC.Core.TyCo.Ppr <= types/TyCoPpr.hs
GHC.Core.TyCo.Rep <= types/TyCoRep.hs
GHC.Core.TyCo.Subst <= types/TyCoSubst.hs
GHC.Core.TyCo.Tidy <= types/TyCoTidy.hs
GHC.Core.Coercion.Axiom <= types/CoAxiom.hs
GHC.Core.Coercion.Opt <= types/OptCoercion.hs
GHC.Core.Opt.Arity <= coreSyn/CoreArity.hs
GHC.Core.Opt.CallArity <= simplCore/CallArity.hs
GHC.Core.Opt.Monad <= simplCore/CoreMonad.hs
GHC.Core.Opt.CSE <= simplCore/CSE.hs
GHC.Core.Opt.Exitify <= simplCore/Exitify.hs
GHC.Core.Opt.FloatIn <= simplCore/FloatIn.hs
GHC.Core.Opt.FloatOut <= simplCore/FloatOut.hs
GHC.Core.Opt.LiberateCase <= simplCore/LiberateCase.hs
GHC.Core.Opt.OccurAnal <= simplCore/OccurAnal.hs
GHC.Core.Opt.StaticArgs <= simplCore/SAT.hs
GHC.Core.Opt.SetLevels <= simplCore/SetLevels.hs
GHC.Core.Opt.Driver <= simplCore/SimplCore.hs
GHC.Core.Opt.Simplify.Env <= simplCore/SimplEnv.hs
GHC.Core.Opt.Simplify <= simplCore/Simplify.hs
GHC.Core.Opt.Simplify.Monad <= simplCore/SimplMonad.hs
GHC.Core.Opt.Simplify.Utils <= simplCore/SimplUtils.hs
GHC.Core.Opt.SpecConstr <= specialise/SpecConstr.hs
GHC.Core.Opt.Specialise <= specialise/Specialise.hs
GHC.Core.Opt.DmdAnal <= stranal/DmdAnal.hs
GHC.Core.Opt.WorkWrap <= stranal/WorkWrap.hs
GHC.Core.Opt.WorkWrap.Utils <= stranal/WwLib.hs
GHC.Core.Opt.ConstantFold <= prelude/PrelRules.hs
-
GHC.Types
:
GHC.Types.Annotation <= main/Annotations.hs
GHC.Types.Avail <= basicTypes/Avail.hs
GHC.Types.Basic <= basicTypes/BasicTypes.hs
GHC.Types.Cpr <= basicTypes/Cpr.hs
GHC.Types.Demand <= basicTypes/Demand.hs
GHC.Types.FieldLabel <= basicTypes/FieldLabel.hs
GHC.Types.Literal <= basicTypes/Literal.hs
GHC.Types.Module <= basicTypes/Module.hs
GHC.Types.RepType <= simplStg/RepType.hs
GHC.Types.SrcLoc <= basicTypes/SrcLoc.hs
GHC.Types.ForeignCall <= prelude/ForeignCall.hs
GHC.Types.Var <= basicTypes/Var.hs
GHC.Types.Var.Set <= basicTypes/VarSet.hs
GHC.Types.Var.Env <= basicTypes/VarEnv.hs
GHC.Types.Id <= basicTypes/Id.hs
GHC.Types.Id.Info <= basicTypes/IdInfo.hs
GHC.Types.Id.Make <= basicTypes/MkId.hs
GHC.Types.Name <= basicTypes/Name.hs
GHC.Types.Name.Occurrence <= basicTypes/OccName.hs
GHC.Types.Name.Reader <= basicTypes/RdrName.hs
GHC.Types.Name.Set <= basicTypes/NameSet.hs
GHC.Types.Name.Shape <= backpack/NameShape.hs
GHC.Types.Name.Cache <= basicTypes/NameCache.hs
GHC.Types.Name.Env <= basicTypes/NameEnv.hs
GHC.Types.CostCentre <= profiling/CostCentre.hs
GHC.Types.CostCentre.State <= profiling/CostCentreState.hs
Merged into GHC.Driver.CodeOutput <= profiling/ProfInit.hs
GHC.Types.Unique <= basicTypes/Unique.hs
GHC.Types.Unique.Supply <= basicTypes/UniqSupply.hs
GHC.Types.Unique.DFM <= utils/UniqDFM.hs
GHC.Types.Unique.DSet <= utils/UniqDSet.hs
GHC.Types.Unique.FM <= utils/UniqFM.hs
GHC.Types.Unique.Set <= utils/UniqSet.hs
GHC.Types.Unique.Map <= utils/UniqMap.hs
GHC.Utils.Lexeme <= basicTypes/Lexeme.hs
GHC.Cmm
GHC.Cmm.BlockId <= cmm/BlockId.hs
GHC.Cmm.CLabel <= cmm/CLabel.hs
GHC.Cmm.CallConv <= cmm/CmmCallConv.hs
GHC.Cmm.CommonBlockElim <= cmm/CmmCommonBlockElim.hs
GHC.Cmm.ContFlowOpt <= cmm/CmmContFlowOpt.hs
GHC.Cmm.Expr <= cmm/CmmExpr.hs
GHC.Cmm <= cmm/Cmm.hs
GHC.Cmm.Switch <= cmm/CmmSwitch.hs
GHC.Cmm.Switch.Implement <= cmm/CmmImplementSwitchPlans.hs
GHC.Cmm.Info <= cmm/CmmInfo.hs
GHC.Cmm.Info.Build <= cmm/CmmBuildInfoTables.hs
GHC.Cmm.LayoutStack <= cmm/CmmLayoutStack.hs
GHC.Cmm.Lint <= cmm/CmmLint.hs
GHC.Cmm.Liveness <= cmm/CmmLive.hs
GHC.Cmm.MachOp <= cmm/CmmMachOp.hs
GHC.Cmm.Monad <= cmm/CmmMonad.hs
GHC.Cmm.Node <= cmm/CmmNode.hs
GHC.Cmm.Opt <= cmm/CmmOpt.hs
GHC.Cmm.Pipeline <= cmm/CmmPipeline.hs
GHC.Cmm.ProcPoint <= cmm/CmmProcPoint.hs
GHC.Cmm.Sink <= cmm/CmmSink.hs
GHC.Cmm.Type <= cmm/CmmType.hs
GHC.Cmm.Utils <= cmm/CmmUtils.hs
GHC.Cmm.DebugBlock <= cmm/Debug.hs
GHC.Cmm.Dataflow.Block <= cmm/Hoopl/Block.hs
GHC.Cmm.Dataflow.Collections <= cmm/Hoopl/Collections.hs
GHC.Cmm.Dataflow <= cmm/Hoopl/Dataflow.hs
GHC.Cmm.Dataflow.Graph <= cmm/Hoopl/Graph.hs
GHC.Cmm.Dataflow.Label <= cmm/Hoopl/Label.hs
GHC.Cmm.Graph <= cmm/MkGraph.hs
GHC.Cmm.Ppr.Decl <= cmm/PprCmmDecl.hs
GHC.Cmm.Ppr.Expr <= cmm/PprCmmExpr.hs
GHC.Cmm.Ppr <= cmm/PprCmm.hs
GHC.Cmm.Lexer <= cmm/CmmLex.x
GHC.Cmm.Parser <= cmm/CmmParse.y
GHC.CmmToC <= cmm/PprC.hs
GHC.Tc
GHC.Tc.Deriv <= typecheck/TcDeriv.hs
GHC.Tc.Deriv.Infer <= typecheck/TcDerivInfer.hs
GHC.Tc.Deriv.Utils <= typecheck/TcDerivUtils.hs
GHC.Tc.Deriv.Generate <= typecheck/TcGenDeriv.hs
GHC.Tc.Deriv.Functor <= typecheck/TcGenFunctor.hs
GHC.Tc.Deriv.Generics <= typecheck/TcGenGenerics.hs
GHC.Tc.Solver <= typecheck/TcSimplify.hs
GHC.Tc.Solver.Interact <= typecheck/TcInteract.hs
GHC.Tc.Solver.Monad <= typecheck/TcSMonad.hs
GHC.Tc.Solver.Canonical <= typecheck/TcCanonical.hs
GHC.Tc.Solver.Flatten <= typecheck/TcFlatten.hs
GHC.Tc.Types <= typecheck/TcRnTypes.hs
GHC.Tc.Types.Constraint <= typecheck/Constraint.hs
GHC.Tc.Types.Origin <= typecheck/TcOrigin.hs
GHC.Tc.Types.Evidence <= typecheck/TcEvidence.hs
GHC.Tc.Types.EvTerm <= typecheck/TcEvTerm.hs
GHC.Tc.Utils.Backpack <= typecheck/TcBackpack.hs
GHC.Tc.Utils.Env <= typecheck/TcEnv.hs
GHC.Tc.Utils.Instantiate <= typecheck/Inst.hs
GHC.Tc.Utils.Monad <= typecheck/TcRnMonad.hs
GHC.Tc.Utils.TcMType <= typecheck/TcMType.hs
GHC.Tc.Utils.TcType <= typecheck/TcType.hs
GHC.Tc.Utils.Unify <= typecheck/TcUnify.hs
GHC.Tc.Utils.Zonk <= typecheck/TcHsSyn.hs
GHC.Tc.Instance.Class <= typecheck/ClsInst.hs
GHC.Tc.Instance.Family <= typecheck/FamInst.hs
GHC.Tc.Instance.Typeable <= typecheck/TcTypeable.hs
GHC.Tc.Instance.FunDeps <= typecheck/FunDeps.hs
GHC.Tc.Gen.Annotation <= typecheck/TcAnnotations.hs
GHC.Tc.Gen.Arrow <= typecheck/TcArrows.hs
GHC.Tc.Gen.Bind <= typecheck/TcBinds.hs
GHC.Tc.Gen.Default <= typecheck/TcDefaults.hs
GHC.Tc.Gen.Export <= typecheck/TcRnExports.hs
GHC.Tc.Gen.Expr <= typecheck/TcExpr.hs
GHC.Tc.Gen.Foreign <= typecheck/TcForeign.hs
GHC.Tc.Gen.HsType <= typecheck/TcHsType.hs
GHC.Tc.Gen.Match <= typecheck/TcMatches.hs
GHC.Tc.Gen.Pat <= typecheck/TcPat.hs
GHC.Tc.Gen.Rule <= typecheck/TcRules.hs
GHC.Tc.Gen.Sig <= typecheck/TcSigs.hs
GHC.Tc.Gen.Splice <= typecheck/TcSplice.hs
GHC.Tc.Errors <= typecheck/TcErrors.hs
GHC.Tc.Errors.Hole <= typecheck/TcHoleErrors.hs
GHC.Tc.Errors.Hole.FitTypes <= typecheck/TcHoleFitTypes.hs
GHC.Tc.TyCl <= typecheck/TcTyClsDecls.hs
GHC.Tc.TyCl.Build <= iface/BuildTyCl.hs
GHC.Tc.TyCl.Class <= typecheck/TcClassDcl.hs
GHC.Tc.TyCl.Instance <= typecheck/TcInstDcls.hs
GHC.Tc.TyCl.PatSyn <= typecheck/TcPatSyn.hs
GHC.Tc.TyCl.Utils <= typecheck/TcTyDecls.hs
GHC.Tc.Module <= typecheck/TcRnDriver.hs
GHC.Tc.Validity <= typecheck/TcValidity.hs
GHC.Tc.Plugin <= typecheck/TcPluginM.hs
GHC.HsToCore
GHC.HsToCore.PmCheck <= deSugar/Check.hs
GHC.HsToCore.PmCheck.Oracle <= deSugar/PmOracle.hs
GHC.HsToCore.PmCheck.Ppr <= deSugar/PmPpr.hs
GHC.HsToCore.PmCheck.Types <= deSugar/PmTypes.hs
GHC.HsToCore <= deSugar/Desugar.hs
GHC.HsToCore.Coverage <= deSugar/Coverage.hs
GHC.HsToCore.Arrows <= deSugar/DsArrows.hs
GHC.HsToCore.Binds <= deSugar/DsBinds.hs
GHC.HsToCore.Foreign.Call <= deSugar/DsCCall.hs
GHC.HsToCore.Foreign.Decl <= deSugar/DsForeign.hs
GHC.HsToCore.Expr <= deSugar/DsExpr.hs
GHC.HsToCore.GuardedRHSs <= deSugar/DsGRHSs.hs
GHC.HsToCore.ListComp <= deSugar/DsListComp.hs
GHC.HsToCore.Quote <= deSugar/DsMeta.hs
GHC.HsToCore.Monad <= deSugar/DsMonad.hs
GHC.HsToCore.Usage <= deSugar/DsUsage.hs
GHC.HsToCore.Utils <= deSugar/DsUtils.hs
GHC.HsToCore.Docs <= deSugar/ExtractDocs.hs
GHC.HsToCore.Match <= deSugar/Match.hs
GHC.HsToCore.Match.Constructor <= deSugar/MatchCon.hs
GHC.HsToCore.Match.Literal <= deSugar/MatchLit.hs
- Stg
GHC.Stg.Pipeline <= simplStg/SimplStg.hs
GHC.Stg.CSE <= simplStg/StgCse.hs
GHC.Stg.Stats <= simplStg/StgStats.hs
GHC.Stg.Unarise <= simplStg/UnariseStg.hs
GHC.Stg.FVs <= stgSyn/StgFVs.hs
GHC.Stg.Lint <= stgSyn/StgLint.hs
GHC.Stg.Subst <= stgSyn/StgSubst.hs
GHC.Stg.Syntax <= stgSyn/StgSyn.hs
GHC.Stg.Lift <= simplStg/StgLiftLams.hs merged with simplStg/StgLiftLams/Transformation.hs
GHC.Stg.Lift.Analysis <= simplStg/StgLiftLams/Analysis.hs
GHC.Stg.Lift.Monad <= simplStg/StgLiftLams/LiftM.hs
GHC.CoreToStg <= stgSyn/CoreToStg.hs
GHC.CoreToStg.Prep <= coreSyn/CorePrep.hs
- Builtin
GHC.Builtin.Uniques <= prelude/KnownUniques.hs
GHC.Builtin.Utils <= prelude/PrelInfo.hs
GHC.Builtin.Names <= prelude/PrelNames.hs
GHC.Builtin.Names.TH <= prelude/THNames.hs
GHC.Builtin.PrimOps <= prelude/PrimOp.hs
GHC.Builtin.Types <= prelude/TysWiredIn.hs
GHC.Builtin.Types.Literals <= typecheck/TcTypeNats.hs
GHC.Builtin.Types.Prim <= prelude/TysPrim.hs
GHC.Iface
GHC.Iface.Binary <= iface/BinIface.hs
GHC.Iface.Env <= iface/IfaceEnv.hs
GHC.Iface.Syntax <= iface/IfaceSyn.hs
GHC.Iface.Type <= iface/IfaceType.hs
GHC.Iface.Load <= iface/LoadIface.hs
GHC.Iface.Utils <= iface/MkIface.hs
GHC.Iface.Rename <= backpack/RnModIface.hs
GHC.Iface.Tidy <= main/TidyPgm.hs
GHC.Iface.Tidy.StaticPtrTable <= main/StaticPtrTable.hs
GHC.Iface.UpdateCafInfos <= main/UpdateCafInfos.hs
GHC.Iface.Ext.Ast <= hieFile/HieAst.hs
GHC.Iface.Ext.Binary <= hieFile/HieBin.hs
GHC.Iface.Ext.Debug <= hieFile/HieDebug.hs
GHC.Iface.Ext.Types <= hieFile/HieTypes.hs
GHC.Iface.Ext.Utils <= hieFile/HieUtils.hs
GHC.Iface.Recomp.Binary <= iface/BinFingerprint.hs
GHC.Iface.Recomp.Flags <= iface/FlagChecker.hs
GHC.IfaceToCore <= iface/TcIface.hs
GHC.CoreToIface <= iface/ToIface.hs
-
GHC.ByteCode
:
GHC.ByteCode.Asm <= ghci/ByteCodeAsm.hs
GHC.ByteCode.Instr <= ghci/ByteCodeInstr.hs
GHC.ByteCode.InfoTable <= ghci/ByteCodeItbls.hs
GHC.ByteCode.Linker <= ghci/ByteCodeLink.hs
GHC.ByteCode.Types <= ghci/ByteCodeTypes.hs
GHC.CoreToByteCode <= ghci/ByteCodeGen.hs
-
GHC.Llvm
:
GHC.Llvm.MetaData <= llvmGen/Llvm/MetaData.hs
GHC.Llvm.Ppr <= llvmGen/Llvm/PpLlvm.hs
GHC.Llvm.Types <= llvmGen/Llvm/Types.hs
GHC.Llvm.Syntax <= llvmGen/Llvm/AbsSyn.hs
GHC.Llvm <= llvmGen/Llvm.hs
GHC.CmmToLlvm <= llvmGen/LlvmCodeGen.hs
GHC.CmmToLlvm.Mangler <= llvmGen/LlvmMangler.hs
GHC.CmmToLlvm.Base <= llvmGen/LlvmCodeGen/Base.hs
GHC.CmmToLlvm.CodeGen <= llvmGen/LlvmCodeGen/CodeGen.hs
GHC.CmmToLlvm.Data <= llvmGen/LlvmCodeGen/Data.hs
GHC.CmmToLlvm.Ppr <= llvmGen/LlvmCodeGen/Ppr.hs
GHC.CmmToLlvm.Regs <= llvmGen/LlvmCodeGen/Regs.hs
-
GHC.Runtime
:
GHC.Runtime.Debugger <= ghci/Debugger.hs
GHC.Runtime.Interpreter <= ghci/GHCi.hs
GHC.Runtime.Linker <= ghci/Linker.hs
GHC.Runtime.Linker.Types <= ghci/LinkerTypes.hs
GHC.Runtime.Loader <= main/DynamicLoading.hs
GHC.Runtime.Eval <= main/InteractiveEval.hs
GHC.Runtime.Eval.Types <= main/InteractiveEvalTypes.hs
GHC.Runtime.Heap.Layout <= cmm/SMRep.hs
GHC.Runtime.Heap.Inspect <= ghci/RtClosureInspect.hs
-
GHC.Driver
:
GHC.Driver.Backpack.Syntax <= backpack/BkpSyn.hs
GHC.Driver.Backpack <= backpack/DriverBkp.hs
GHC.Driver.CmdLine <= main/CmdLineParser.hs
GHC.Driver.CodeOutput <= main/CodeOutput.hs
GHC.Driver.Finder <= main/Finder.hs
GHC.Driver.MakeFile <= main/DriverMkDepend.hs
GHC.Driver.Main <= main/HscMain.hs
GHC.Driver.Make <= main/GhcMake.hs
GHC.Driver.Hooks <= main/Hooks.hs
GHC.Driver.Session <= main/DynFlags.hs
GHC.Driver.Packages <= main/Packages.hs
GHC.Driver.Phases <= main/DriverPhases.hs
GHC.Driver.Pipeline <= main/DriverPipeline.hs
GHC.Driver.Pipeline.Monad <= main/PipelineMonad.hs
GHC.Driver.Plugins <= main/Plugins.hs
GHC.Driver.Monad <= main/GhcMonad.hs
GHC.Driver.Types <= main/HscTypes.hs RAE: this 3,200-line file is imported by low-level things. I suppose it will have to be broken up.
GHC.Plugins <= main/GhcPlugins.hs -- module imported by plugins
GHC <= main/GHC.hs -- imported by GHC API users (could need some cleanup)
-
GHC.CmmToAsm
:
GHC.CmmToAsm <= nativeGen/AsmCodeGen.hs
GHC.CmmToAsm.BlockLayout <= nativeGen/BlockLayout.hs
GHC.CmmToAsm.CFG <= nativeGen/CFG.hs
GHC.CmmToAsm.CFG.Dominators <= utils/Dominators.hs
GHC.CmmToAsm.CPrim <= nativeGen/CPrim.hs
GHC.CmmToAsm.Dwarf.Constants <= nativeGen/Dwarf/Constants.hs
GHC.CmmToAsm.Dwarf <= nativeGen/Dwarf.hs
GHC.CmmToAsm.Dwarf.Types <= nativeGen/Dwarf/Types.hs
GHC.CmmToAsm.Format <= nativeGen/Format.hs
GHC.CmmToAsm.Instr <= nativeGen/Instruction.hs
GHC.CmmToAsm.Monad <= nativeGen/NCGMonad.hs
GHC.CmmToAsm.PIC <= nativeGen/PIC.hs
GHC.CmmToAsm.Ppr <= nativeGen/PprBase.hs
GHC.CmmToAsm.Reg.Graph.Base <= nativeGen/RegAlloc/Graph/ArchBase.hs
GHC.CmmToAsm.Reg.Graph.X86 <= nativeGen/RegAlloc/Graph/ArchX86.hs
GHC.CmmToAsm.Reg.Graph.Coalesce <= nativeGen/RegAlloc/Graph/Coalesce.hs
GHC.CmmToAsm.Reg.Graph <= nativeGen/RegAlloc/Graph/Main.hs
GHC.CmmToAsm.Reg.Graph.SpillClean <= nativeGen/RegAlloc/Graph/SpillClean.hs
GHC.CmmToAsm.Reg.Graph.SpillCost <= nativeGen/RegAlloc/Graph/SpillCost.hs
GHC.CmmToAsm.Reg.Graph.Spill <= nativeGen/RegAlloc/Graph/Spill.hs
GHC.CmmToAsm.Reg.Graph.Stats <= nativeGen/RegAlloc/Graph/Stats.hs
GHC.CmmToAsm.Reg.Graph.TrivColorable <= nativeGen/RegAlloc/Graph/TrivColorable.hs
GHC.CmmToAsm.Reg.Linear.Base <= nativeGen/RegAlloc/Linear/Base.hs
GHC.CmmToAsm.Reg.Linear.JoinToTargets <= nativeGen/RegAlloc/Linear/JoinToTargets.hs
GHC.CmmToAsm.Reg.Linear <= nativeGen/RegAlloc/Linear/Main.hs
GHC.CmmToAsm.Reg.Linear.StackMap <= nativeGen/RegAlloc/Linear/StackMap.hs
GHC.CmmToAsm.Reg.Linear.State <= nativeGen/RegAlloc/Linear/State.hs
GHC.CmmToAsm.Reg.Linear.Stats <= nativeGen/RegAlloc/Linear/Stats.hs
GHC.CmmToAsm.Reg.Linear.FreeRegs <= nativeGen/RegAlloc/Linear/FreeRegs.hs
GHC.CmmToAsm.Reg.Linear.PPC <= nativeGen/RegAlloc/Linear/PPC/FreeRegs.hs
GHC.CmmToAsm.Reg.Linear.SPARC <= nativeGen/RegAlloc/Linear/SPARC/FreeRegs.hs
GHC.CmmToAsm.Reg.Linear.X86_64 <= nativeGen/RegAlloc/Linear/X86_64/FreeRegs.hs
GHC.CmmToAsm.Reg.Linear.X86 <= nativeGen/RegAlloc/Linear/X86/FreeRegs.hs
GHC.Platform.Reg <= nativeGen/Reg.hs
GHC.Platform.Reg.Class <= nativeGen/RegClass.hs
GHC.CmmToAsm.Reg.Liveness <= nativeGen/RegAlloc/Liveness.hs
GHC.CmmToAsm.Reg.Target <= nativeGen/TargetReg.hs
GHC.CmmToAsm.PPC.CodeGen <= nativeGen/PPC/CodeGen.hs
GHC.CmmToAsm.PPC.Cond <= nativeGen/PPC/Cond.hs
GHC.CmmToAsm.PPC.Instr <= nativeGen/PPC/Instr.hs
GHC.CmmToAsm.PPC.Ppr <= nativeGen/PPC/Ppr.hs
GHC.CmmToAsm.PPC.RegInfo <= nativeGen/PPC/RegInfo.hs
GHC.CmmToAsm.PPC.Regs <= nativeGen/PPC/Regs.hs
GHC.CmmToAsm.SPARC.AddrMode <= nativeGen/SPARC/AddrMode.hs
GHC.CmmToAsm.SPARC.Base <= nativeGen/SPARC/Base.hs
GHC.CmmToAsm.SPARC.CodeGen.Amode <= nativeGen/SPARC/CodeGen/Amode.hs
GHC.CmmToAsm.SPARC.CodeGen.Base <= nativeGen/SPARC/CodeGen/Base.hs
GHC.CmmToAsm.SPARC.CodeGen.CondCode <= nativeGen/SPARC/CodeGen/CondCode.hs
GHC.CmmToAsm.SPARC.CodeGen.Expand <= nativeGen/SPARC/CodeGen/Expand.hs
GHC.CmmToAsm.SPARC.CodeGen.Gen32 <= nativeGen/SPARC/CodeGen/Gen32.hs
GHC.CmmToAsm.SPARC.CodeGen.Gen64 <= nativeGen/SPARC/CodeGen/Gen64.hs
GHC.CmmToAsm.SPARC.CodeGen <= nativeGen/SPARC/CodeGen.hs
GHC.CmmToAsm.SPARC.CodeGen.Sanity <= nativeGen/SPARC/CodeGen/Sanity.hs
GHC.CmmToAsm.SPARC.Cond <= nativeGen/SPARC/Cond.hs
GHC.CmmToAsm.SPARC.Imm <= nativeGen/SPARC/Imm.hs
GHC.CmmToAsm.SPARC.Instr <= nativeGen/SPARC/Instr.hs
GHC.CmmToAsm.SPARC.Ppr <= nativeGen/SPARC/Ppr.hs
GHC.CmmToAsm.SPARC.Regs <= nativeGen/SPARC/Regs.hs
GHC.CmmToAsm.SPARC.ShortcutJump <= nativeGen/SPARC/ShortcutJump.hs
GHC.CmmToAsm.SPARC.Stack <= nativeGen/SPARC/Stack.hs
GHC.CmmToAsm.X86.CodeGen <= nativeGen/X86/CodeGen.hs
GHC.CmmToAsm.X86.Cond <= nativeGen/X86/Cond.hs
GHC.CmmToAsm.X86.Instr <= nativeGen/X86/Instr.hs
GHC.CmmToAsm.X86.Ppr <= nativeGen/X86/Ppr.hs
GHC.CmmToAsm.X86.RegInfo <= nativeGen/X86/RegInfo.hs
GHC.CmmToAsm.X86.Regs <= nativeGen/X86/Regs.hs
-
GHC.Data
:
GHC.Data.Bitmap <= cmm/Bitmap.hs
GHC.Data.Bag <= utils/Bag.hs
GHC.Data.BooleanFormula <= utils/BooleanFormula.hs
GHC.Data.EnumSet <= utils/EnumSet.hs
GHC.Data.FastMutInt <= utils/FastMutInt.hs
GHC.Data.FastString.Env <= utils/FastStringEnv.hs
GHC.Data.FastString <= utils/FastString.hs
GHC.Data.Graph.Base <= utils/GraphBase.hs
GHC.Data.Graph.Color <= utils/GraphColor.hs
GHC.Data.Graph.Directed <= utils/Digraph.hs
GHC.Data.Graph.Ops <= utils/GraphOps.hs
GHC.Data.Graph.Ppr <= utils/GraphPpr.hs
GHC.Data.Graph.UnVar <= utils/UnVarGraph.hs
GHC.Data.IOEnv <= utils/IOEnv.hs
GHC.Data.List.SetOps <= utils/ListSetOps.hs
GHC.Data.Maybe <= utils/Maybes.hs
GHC.Data.FiniteMap <= utils/FiniteMap.hs
GHC.Data.OrdList <= utils/OrdList.hs
GHC.Data.Pair <= utils/Pair.hs
GHC.Data.Stream <= utils/Stream.hs
GHC.Data.StringBuffer <= utils/StringBuffer.hs
GHC.Data.TrieMap <= utils/TrieMap.hs
-
GHC.Utils
:
GHC.Utils.Asm <= utils/AsmUtils.hs
GHC.Utils.Binary <= utils/Binary.hs
GHC.Utils.BufHandle <= utils/BufWrite.hs
GHC.Utils.Encoding <= utils/Encoding.hs
GHC.Utils.Exception <= utils/Exception.hs
GHC.Utils.FingerPrint <= utils/Fingerprint.hs
GHC.Utils.Json <= utils/Json.hs
GHC.Utils.Outputable <= utils/Outputable.hs
GHC.Utils.Panic <= utils/Panic.hs
GHC.Utils.Panic.Plain <= utils/PlainPanic.hs
GHC.Utils.Ppr.Colour <= utils/PprColour.hs
GHC.Utils.Ppr <= utils/Pretty.hs
GHC.Utils.Misc <= utils/Util.hs
GHC.Utils.Error <= main/ErrUtils.hs
GHC.Utils.CliOption <= main/CliOption.hs
GHC.Utils.FV <= utils/FV.hs
GHC.Utils.IO.Unsafe <= utils/FastFunctions.hs
GHC.Utils.Monad.Utils <= utils/MonadUtils.hs
GHC.Utils.Monad.State <= utils/State.hs
GHC.Prelude <= utils/GhcPrelude.hs
GHC.Unit.Info <= main/UnitInfo.hs
-
GHC.SysTools
:
GHC.SysTools.BaseDir <= main/SysTools/BaseDir.hs
GHC.SysTools.ExtraObj <= main/SysTools/ExtraObj.hs
GHC.SysTools <= main/SysTools.hs
GHC.SysTools.Info <= main/SysTools/Info.hs
GHC.SysTools.Process <= main/SysTools/Process.hs
GHC.SysTools.Tasks <= main/SysTools/Tasks.hs
GHC.SysTools.Terminal <= main/SysTools/Terminal.hs
GHC.SysTools.Ar <= main/Ar.hs
GHC.SysTools.Elf <= main/Elf.hs
GHC.SysTools.FileCleanup <= main/FileCleanup.hs
-
GHC.Parser
:
GHC.Parser <= parse/Parser.y
GHC.Parser.Annotation <= parser/ApiAnnotation.hs
GHC.Parser.CharClass <= parser/Ctype.hs
GHC.Parser.Lexer <= parse/Lexer.x
GHC.Parser.Header <= main/HeaderInfo.hs
GHC.Parser.PostProcess <= parser/RdrHsSyn.hs
GHC.Parser.PostProcess.Haddock <= parser/HaddockUtils
-
GHC.Settings
:
GHC.Settings <= main/Settings.hs, main/FileSettings.hs, main/ToolSettings.hs, main/GhcNameVersion.hs, main/PlatformConstants.hs
GHC.Settings.Constants <= main/Constants.hs
GHC.Settings.IO <= main/SysTools/Settings.hs
GHC.Settings.Config <= Config.hs (generated)
in ghc-boot:
GHC.Settings.{Platform,Utils} <= GHC.Settings
Previous attempts
2008
- proposal by Nominolo https://ghc.haskell.org/trac/ghc/wiki/ModuleDependencies/Hierarchical
- I (@hsyl20) don't know what happened to it.
2017
- June: attempt to revive the 2008 proposal by @hsyl20. A fresher renaming has been proposed along with a BIG patch discussed on Phabricator: https://phabricator.haskell.org/D3647.
- writing a GHC proposal about this change has been suggested. It has been written and discussed here: https://github.com/ghc-proposals/ghc-proposals/pull/57
- implementing a compatibility package exporting module old names has been suggested and implemented: https://github.com/hsyl20/ghc-api-compat/blob/master/ghc-api-compat.cabal
- October: the proposal has been flagged as out-of-scope, I've lost the motivation to rebase the big patch.
2019-2020
- no single big patch: smaller patches, one at a time to avoid tiresome rebasing.
- not too much renaming. Mostly replacing prefixes (e.g. StgCmmFoo becomes GHC.StgToCmm.Foo)
Edited by Sylvain Henry