1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
5 <title>The GHC Commentary - Prelude Foundations</title>
8 <body BGCOLOR="FFFFFF">
9 <h1>The GHC Commentary - Prelude Foundations</h1>
11 The standard Haskell Prelude as well as GHC's Prelude extensions are
12 constructed from GHC's <a href="primitives.html">primitives</a> in a
15 <h4><code>PrelBase.lhs</code></h4>
17 Some most elementary Prelude definitions are collected in <a
18 href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/lib/std/PrelBase.lhs"><code>PrelBase.lhs</code></a>.
19 In particular, it defines the boxed versions of Haskell primitive types
20 - for example, <code>Int</code> is defined as
22 data Int = I# Int#</pre>
25 Saying that a boxed integer <code>Int</code> is formed by applying the
26 data constructor <code>I#</code> to an <em>unboxed</em> integer of type
27 <code>Int#</code>. Unboxed types are hardcoded in the compiler and
28 exported together with the <a href="primitives.html">primitive
29 operations</a> understood by GHC.
31 <code>PrelBase.lhs</code> similarly defines basic types, such as,
34 data Bool = False | True deriving (Eq, Ord)</pre>
44 data [] a = [] | a : [a]</pre>
47 It also contains instance delarations for these types. In addition,
48 <code>PrelBase.lhs</code> contains some <a href="prelude.html">tricky
49 machinery</a> for efficient list handling.
53 Last modified: Wed Aug 8 19:30:18 EST 2001