2295db562113670a50ab094a1b55453520dc2553
[ghc-hetmet.git] / ghc / docs / comm / the-beast / basicTypes.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3   <head>
4     <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
5     <title>The GHC Commentary - The Basics</title>
6   </head>
7
8   <body BGCOLOR="FFFFFF">
9     <h1>The GHC Commentary - The Basics</h1>
10     <p>
11       The directory <a
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
15       names.
16
17     <h4><code>Id</code>s</h4>
18     <p>
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.
27     <p>
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
34       <code>IdInfo</code>:
35     <p>
36     <dl>
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>).
45     </dl>
46
47     <p><small>
48 <!-- hhmts start -->
49 Last modified: Wed Aug  8 19:23:01 EST 2001
50 <!-- hhmts end -->
51     </small>
52   </body>
53 </html>