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 - The Basics</title>
8 <body BGCOLOR="FFFFFF">
9 <h1>The GHC Commentary - The Basics</h1>
12 href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/basicTypes/"><code>fptools/ghc/compiler/basicTypes/</code></a>
13 contains modules that define some of the essential types definition for
14 the compiler - such as, identifiers, variables, modules, and unique
17 <h4><code>Id</code>s</h4>
19 An <code>Id</code> (defined in <a
20 href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/basicTypes/Id.lhs"><code>Id.lhs</code></a>
21 essentially records information about value and data constructor
22 identifiers -- to be precise, in the case of data constructors, two
23 <code>Id</code>s are used to represent the worker and wrapper functions
24 for the data constructor, respectively. The information maintained in
25 the <code>Id</code> abstraction includes among other items strictness,
26 occurrence, specialisation, and unfolding information.
28 Due to the way <code>Id</code>s are used for data constructors,
29 all <code>Id</code>s are represented as variables, which contain a
30 <code>varInfo</code> field of abstract type <code><a
31 href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/basicTypes/IdInfo.lhs">IdInfo</a>.IdInfo</code>.
32 This is where the information about <code>Id</code>s is really stored.
33 The following is a (currently, partial) list of the various items in an
37 <dt><a name="occInfo">Occurence information</a>
38 <dd>The <code>OccInfo</code> data type is defined in the module <a
39 href="http://cvs.haskell.org/cgi-bin/cvsweb.cgi/fptools/ghc/compiler/basicTypes/BasicTypes.lhs"><code>BasicTypes.lhs</code></a>.
40 Apart from the trivial <code>NoOccInfo</code>, it distinguishes
41 between variables that do not occur at all (<code>IAmDead</code>),
42 occur just once (<code>OneOcc</code>), or a <a
43 href="simplifier.html#loopBreaker">loop breakers</a>
44 (<code>IAmALoopBreaker</code>).
49 Last modified: Wed Aug 8 19:23:01 EST 2001