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 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.

1.1. Obtaining GHC

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.