X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=docs%2Fcomm%2Fgenesis%2Fmodules.html;fp=docs%2Fcomm%2Fgenesis%2Fmodules.html;h=de59cce6d310e3be459247bbcb715762e10906f6;hp=0000000000000000000000000000000000000000;hb=0065d5ab628975892cea1ec7303f968c3338cbe1;hpb=28a464a75e14cece5db40f2765a29348273ff2d2
diff --git a/docs/comm/genesis/modules.html b/docs/comm/genesis/modules.html
new file mode 100644
index 0000000..de59cce
--- /dev/null
+++ b/docs/comm/genesis/modules.html
@@ -0,0 +1,164 @@
+
+
+
+
+ The GHC Commentary - The Marvellous Module Structure of GHC
+
+
+
+ The GHC Commentary - The Marvellous Module Structure of GHC
+
+
+GHC is built out of about 245 Haskell modules. It can be quite tricky
+to figure out what the module dependency graph looks like. It can be
+important, too, because loops in the module dependency graph need to
+be broken carefully using .hi-boot interface files.
+
+This section of the commentary documents the subtlest part of
+the module dependency graph, namely the part near the bottom.
+
+- The list is given in compilation order: that is,
+module near the top are more primitive, and are compiled earlier.
+
- Each module is listed together with its most critical
+dependencies in parentheses; that is, the dependencies that prevent it being
+compiled earlier.
+
- Modules in the same bullet don't depend on each other.
+
- Loops are documented by a dependency such as "loop Type.Type".
+This means tha the module imports Type.Type, but module Type
+has not yet been compiled, so the import comes from Type.hi-boot.
+
+
+Compilation order is as follows:
+
+-
+First comes a layer of modules that have few interdependencies,
+and which implement very basic data types:
+
+- Util
+
- OccName
+
- Pretty
+
- Outputable
+
- StringBuffer
+
- ListSetOps
+
- Maybes
+
- etc
+
+
+
+
- Now comes the main subtle layer, involving types, classes, type constructors
+identifiers, expressions, rules, and their operations.
+
+
+
+- Name
PrimRep
+ -
+ PrelNames
+
-
+ Var (Name, loop IdInfo.IdInfo,
+ loop Type.Type, loop Type.Kind)
+
-
+ VarEnv, VarSet, ThinAir
+
-
+ Class (loop TyCon.TyCon, loop Type.Type)
+
-
+ TyCon (loop Type.Type, loop Type.Kind, loop DataCon.DataCon, loop Generics.GenInfo)
+
-
+ TypeRep (loop DataCon.DataCon, loop Subst.substTyWith)
+
-
+ Type (loop PprType.pprType, loop Subst.substTyWith)
+
-
+ FieldLabel(Type)
+ TysPrim(Type)
+ -
+ Literal (TysPrim, PprType)
+ DataCon (loop PprType, loop Subst.substTyWith, FieldLabel.FieldLabel)
+ -
+ TysWiredIn (loop MkId.mkDataConIds)
+
-
+ TcType( lots of TysWiredIn stuff)
+
-
+ PprType( lots of TcType stuff )
+
-
+ PrimOp (PprType, TysWiredIn)
+
-
+ CoreSyn [does not import Id]
+
-
+ IdInfo (CoreSyn.Unfolding, CoreSyn.CoreRules)
+
-
+ Id (lots from IdInfo)
+
-
+ CoreFVs
+ PprCore
+ -
+ CoreUtils (PprCore.pprCoreExpr, CoreFVs.exprFreeVars,
+ CoreSyn.isEvaldUnfolding CoreSyn.maybeUnfoldingTemplate)
+
-
+ CoreLint( CoreUtils )
+ OccurAnal (CoreUtils.exprIsTrivial)
+ CoreTidy (CoreUtils.exprArity )
+ -
+ CoreUnfold (OccurAnal.occurAnalyseGlobalExpr)
+
-
+ Subst (CoreUnfold.Unfolding, CoreFVs)
+ Generics (CoreUnfold.mkTopUnfolding)
+ Rules (CoreUnfold.Unfolding, PprCore.pprTidyIdRules)
+ -
+ MkId (CoreUnfold.mkUnfolding, Subst, Rules.addRule)
+
-
+ PrelInfo (MkId)
+ HscTypes( Rules.RuleBase )
+
+
+ - That is the end of the infrastructure. Now we get the
+ main layer of mdoules that perform useful work.
+
+
+-
+ CoreTidy (HscTypes.PersistentCompilerState)
+
+
+
+HsSyn stuff
+
+- HsPat.hs-boot
+
- HsExpr.hs-boot (loop HsPat.LPat)
+
- HsTypes (loop HsExpr.HsSplice)
+
- HsBinds (HsTypes.LHsType, loop HsPat.LPat, HsExpr.pprFunBind and others)
+ HsLit (HsTypes.SyntaxName)
+
- HsPat (HsBinds, HsLit)
+ HsDecls (HsBinds)
+
- HsExpr (HsDecls, HsPat)
+
+
+
+
+Library stuff: base package
+
+
+- GHC.Base
+
- Data.Tuple (GHC.Base), GHC.Ptr (GHC.Base)
+
- GHC.Enum (Data.Tuple)
+
- GHC.Show (GHC.Enum)
+
- GHC.Num (GHC.Show)
+
- GHC.ST (GHC.Num), GHC.Real (GHC.Num)
+
- GHC.Arr (GHC.ST) GHC.STRef (GHC.ST)
+
- GHC.IOBase (GHC.Arr)
+
- Data.Bits (GHC.Real)
+
- Data.HashTable (Data.Bits, Control.Monad)
+
- Data.Typeable (GHC.IOBase, Data.HashTable)
+
- GHC.Weak (Data.Typeable, GHC.IOBase)
+
+
+
+
+
+Last modified: Wed Aug 22 16:46:33 GMT Daylight Time 2001
+
+
+
+
+
+
+
+
+