|Version 9 (modified by 8 years ago) (diff),|
GHC Commentary: Libraries
All GHC installations contain a set of libraries called the boot packages. They are so called because the boot packages are the ones required for GHC to compile itself (the stage-2 bootstrap compiler).
The boot packages, along with the other subcomponents of the GHC build system, are in the file
packages in a GHC tree. To get a list of them, you can run
make show VALUE=PACKAGES in a configured GHC build tree.
- At the root of the hierarchy we have
ghc-prim. As the name implies, this package contains the most primitive types and functions. It only contains a handful of modules, including
+#, etc) and
GHC.Bool, containing the
integerpackage, which provides a definition of the
Integertype on top of the C
gmplibrary. Which functionality is provided in
ghc-primis mostly driven by what functionality the
integerpackage needs. Unlike all the other libraries, the
integerpackage does not live in
libraries/integer-gmp. This allows alternate implementations to be used, by defining
- Next is the
basepackage. This contains a large number of modules, many of which are in one big cyclic import knot, mostly due to the
Exceptiontype. This is something that we hope to improve upon, so that base can be split up.
- On top of base are a number of other, more specialised packages, whose purpose is generally clear from their name. If not, you can get more detail from the descriptions in their Cabal files. Currently these packages are are: