|
|
# GHC Commentary: Libraries
|
|
|
|
|
|
**OUT OF DATE: IAN WILL UPDATE**
|
|
|
|
|
|
|
|
|
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 file `libraries/boot-packages` contains the list of boot packages:
|
|
|
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 tree 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 `GHC.Prim` (which contains `Int#`, `+#`, etc) and `GHC.Bool`, containing the `Bool` datatype.
|
|
|
- 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 `GHC.Prim` (which contains `Int#`, `+#`, etc) and `GHC.Bool`, containing the `Bool` datatype.
|
|
|
|
|
|
- Above `ghc-prim` is the **`integer`** package, which provides a definition of the `Integer` type on top of the C `gmp` library. Which functionality is provided in `ghc-prim` is mostly driven by what functionality the `integer` package needs. Unlike all the other libraries, the `integer` package does not live in `libraries/integer`, but `libraries/integer-gmp`. This allows alternate implementations to be used, by defining `INTEGER_LIBRARY=integer-foo` in `mk/build.mk`.
|
|
|
|
... | ... | @@ -21,19 +19,21 @@ The file `libraries/boot-packages` contains the list of boot packages: |
|
|
- `Cabal`
|
|
|
- `containers`
|
|
|
- `directory`
|
|
|
- `editline`
|
|
|
- `extensible-exceptions`
|
|
|
- `filepath`
|
|
|
- `haskeline`
|
|
|
- `haskell98`
|
|
|
- `hpc`
|
|
|
- `mtl`
|
|
|
- `old-locale`
|
|
|
- `old-time`
|
|
|
- `packedstring`
|
|
|
- `pretty`
|
|
|
- `process`
|
|
|
- `random`
|
|
|
- `syb`
|
|
|
- `template-haskell`
|
|
|
- `terminfo`
|
|
|
- `unix`
|
|
|
- `Win32`
|
|
|
|
|
|
> >
|
|
|
> > However the definitive list is in `libraries/boot-packages` |
|
|
\ No newline at end of file |
|
|
- `utf8-string`
|
|
|
- `Win32` |
|
|
\ No newline at end of file |