Chapter 1. Introduction to GHC
Table of Contents
- 1.1. Obtaining GHC
- 1.2. Meta-information: Web sites, mailing lists, etc.
- 1.3. Reporting bugs in GHC
- 1.4. GHC version numbering policy
- 1.5. Release notes for version 6.12.3
- 1.5.1. Compiler and Runtime system
- 1.5.2. Libraries
- 1.5.2.1. array
- 1.5.2.2. base
- 1.5.2.3. bytestring
- 1.5.2.4. Cabal
- 1.5.2.5. containers
- 1.5.2.6. directory
- 1.5.2.7.
dph
(dph-base, dph-par, dph-prim-interface, dph-prim-par,
dph-prim-seq, dph-seq)
- 1.5.2.8. extensible-exceptions
- 1.5.2.9. filepath
- 1.5.2.10. ghc-binary
- 1.5.2.11. ghc-prim
- 1.5.2.12. haskell98
- 1.5.2.13. hpc
- 1.5.2.14. integer-gmp
- 1.5.2.15. integer-simple
- 1.5.2.16. old-locale
- 1.5.2.17. old-time
- 1.5.2.18. pretty
- 1.5.2.19. process
- 1.5.2.20. random
- 1.5.2.21. syb
- 1.5.2.22. template-haskell
- 1.5.2.23. time
- 1.5.2.24. unix
- 1.5.2.25. Win32
- 1.6. Release notes for version 6.12.2
- 1.6.1. Compiler and Runtime system
- 1.6.2. Template Haskell
- 1.6.3. Libraries
- 1.6.3.1. array
- 1.6.3.2. base
- 1.6.3.3. bytestring
- 1.6.3.4. Cabal
- 1.6.3.5. containers
- 1.6.3.6. directory
- 1.6.3.7.
dph
(dph-base, dph-par, dph-prim-interface, dph-prim-par,
dph-prim-seq, dph-seq)
- 1.6.3.8. extensible-exceptions
- 1.6.3.9. filepath
- 1.6.3.10. ghc-binary
- 1.6.3.11. ghc-prim
- 1.6.3.12. haskell98
- 1.6.3.13. hpc
- 1.6.3.14. integer-gmp
- 1.6.3.15. integer-simple
- 1.6.3.16. old-locale
- 1.6.3.17. old-time
- 1.6.3.18. pretty
- 1.6.3.19. process
- 1.6.3.20. random
- 1.6.3.21. syb
- 1.6.3.22. template-haskell
- 1.6.3.23. time
- 1.6.3.24. unix
- 1.6.3.25. Win32
- 1.7. Release notes for version 6.12.1
- 1.7.1. Highlights
- 1.7.2. Language changes
- 1.7.3. Warnings
- 1.7.4. Runtime system
- 1.7.5. Build system
- 1.7.6. Compiler
- 1.7.7. GHCi
- 1.7.8. Template Haskell
- 1.7.9. Package Handling
- 1.7.10. Libraries
- 1.7.10.1. array
- 1.7.10.2. base
- 1.7.10.3. bytestring
- 1.7.10.4. Cabal
- 1.7.10.5. containers
- 1.7.10.6. directory
- 1.7.10.7.
dph
(dph-base, dph-par, dph-prim-interface, dph-prim-par,
dph-prim-seq, dph-seq)
- 1.7.10.8. extensible-exceptions
- 1.7.10.9. filepath
- 1.7.10.10. ghc-binary
- 1.7.10.11. ghc-prim
- 1.7.10.12. haskell98
- 1.7.10.13. hpc
- 1.7.10.14. integer-gmp
- 1.7.10.15. integer-simple
- 1.7.10.16. old-locale
- 1.7.10.17. old-time
- 1.7.10.18. packedstring
- 1.7.10.19. pretty
- 1.7.10.20. process
- 1.7.10.21. random
- 1.7.10.22. syb
- 1.7.10.23. template-haskell
- 1.7.10.24. time
- 1.7.10.25. unix
- 1.7.10.26. Win32
This is a guide to using the Glasgow Haskell Compiler (GHC):
an interactive and batch compilation system for the Haskell 98
language.
GHC has two main components: an interactive Haskell
interpreter (also known as GHCi), described in Chapter 2, Using GHCi, and a batch compiler, described throughout Chapter 4, Using GHC. In fact, GHC consists of a single program
which is just run with different options to provide either the
interactive or the batch system.
The batch compiler can be used alongside GHCi: compiled
modules can be loaded into an interactive session and used in the
same way as interpreted code, and in fact when using GHCi most of
the library code will be pre-compiled. This means you get the best
of both worlds: fast pre-compiled library code, and fast compile
turnaround for the parts of your program being actively
developed.
GHC supports numerous language extensions, including
concurrency, a foreign function interface, exceptions, type system
extensions such as multi-parameter type classes, local universal and
existential quantification, functional dependencies, scoped type
variables and explicit unboxed types. These are all described in
Chapter 7, GHC Language Features.
GHC has a comprehensive optimiser, so when you want to Really
Go For It (and you've got time to spare) GHC can produce pretty fast
code. Alternatively, the default option is to compile as fast as
possible while not making too much effort to optimise the generated
code (although GHC probably isn't what you'd describe as a fast
compiler :-).
GHC's profiling system supports “cost centre
stacks”: a way of seeing the profile of a Haskell program in a
call-graph like structure. See Chapter 5, Profiling for more
details.
GHC comes with a number of libraries. These are
described in separate documentation.
Go to the GHC home
page and follow the "download" link to download GHC
for your platform.
Alternatively, if you want to build GHC yourself, head on
over to the
GHC
Building Guide to find out how to get the sources, and
build it on your system. Note that GHC itself is written in
Haskell, so you will still need to install GHC in order to
build it.