[Start work on ch02. Bryan O'Sullivan **20070627060425] { hunk ./en/ch02-starting.xml 7 - Installing GHC - FIXME: How to download and install GHC for Windows, OS X, and Linux. Not - much detail, since details bitrot fast. - + Your Haskell environment + + There's a number of Haskell implementations available, of + which two are in wide use. Hugs 98 is an interpreter that is + primarily used for teaching. For real applications, the Glasgow + Haskell Compiler, or &GHC; as it's usually known, is much more + popular. + + &GHC; has two complementary components: &ghc;, a compiler + that generates native code, and &ghci;, an interpreter that can + run either interactively or in batch mode. + + + When we talk about the package as a whole, we'll refer to + &GHC;. If we're talking about one or other command, we'll + mention either &ghc; or &ghci;. + + + In this book, we assume that you're using at least version + 6.6.1 of &GHC;. To obtain a copy of &GHC; for your platform, + visit the + &GHC; download page, and look for the list of binary + packages. If you're using Windows or Mac OS X, these binary + packages are the best ones to use. + + Many Linux distributions, and BSD and other Unix variants, + make pre-packaged versions of &GHC; available. Because they are + built specifically for each environment, these packages are less + hassle to use than the generic binary packages. You can find a + list of such packages at the &GHC; distribution + packages page. + + + + + Installing GHC on your platform + + We are providing the instructions below based on our + experience installing &GHC; in mid-2007. Installation + instructions inevitably become dated quickly; please bear this + in mind as you read. + + Because &GHC; runs on a large number of platforms, we've + focused on a handful of the most popular. + + + Windows + + The prebuilt binary packages of &GHC; should work on + versions of Windows as old as ME, and on all newer versions + (NT, 2000, XP, and Vista). We have installed &GHC; 6.6.1 + under Windows XP Service Pack 2. + + Our first step is to visit the &GHC; download + page, and follow the link to the current stable + release. Scroll down to the section entitled Binary + packages, and then again to the subsection for + Windows. Download the installer. + + FIXME: actual content. + + + + Mac OS X + + Installing &GHC; on Mac OS X takes a few steps. We have + installed &GHC; 6.6.1 under Mac OS X 10.4, on an Intel-based + MacBook. + + Our first step is to visit the &GHC; download + page, and follow the link to the current stable + release. Scroll down to the section entitled Binary + packages, and then again to the subsection for Mac + OS X. There are three components to download. + + + + The GNUreadline framework + provides flexible command line editing. + + + The GMP framework is required for + arbitrary-precision integer support. + + + The &GHC; package itself. This will not work unless + both of the preceding frameworks are installed. + + + + FIXME: actual content. + + + + Ubuntu and Debian Linux + + FIXME: actual content. + + + + Fedora Linux + + &GHC; is packaged for Fedora. From a shell, all you need + to do is run sudo yum -y install ghc ghc-doc + ghc661-prof. The base package, containing the + &ghc; and &ghci; commands and libraries, is + ghc. The ghc-doc + package contains the &GHC; user guide, and command and library + documentation. The ghc661-prof package + contains profiling-capable versions of the standard libraries + (note: its version number may have changed by the time you + read this). + + Once installation has finished, you should be able to run + &ghci; from the shell immediately. You won't need to change + your shell's search path, or set any environment + variables. + hunk ./en/ch02-starting.xml 131 - Using ghci + Getting started with ghci, the interpreter + + The interactive interpreter for &GHC; is a program named + &ghci;. It lets you enter and evaluate Haskell expressions, and + explore modules and type information. + }