[project @ 2003-08-27 13:28:01 by panne]
[ghc-hetmet.git] / ghc / docs / users_guide / using.sgml
index a5a691b..bd36665 100644 (file)
@@ -4,61 +4,63 @@
   <indexterm><primary>GHC, using</primary></indexterm>
   <indexterm><primary>using GHC</primary></indexterm>
 
-    <para>GHC can work in one of three &ldquo;modes&rdquo;:</para>
-
-    <variablelist>
-      <varlistentry>
-       <term><cmdsynopsis><command>ghc</command>
-           <arg choice=plain>--interactive</arg>
-         </cmdsynopsis></term>
-       <indexterm><primary>interactive mode</primary>
-       </indexterm>
-       <indexterm><primary>ghci</primary>
-       </indexterm>
-       <listitem>
-         <para>Interactive mode, which is also available as
-         <command>ghci</command>.  Interactive mode is described in
-         more detail in <xref linkend="ghci">.</para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term><cmdsynopsis><command>ghc</command>
-           <arg choice=plain>--make</arg>
-         </cmdsynopsis></term>
-       <indexterm><primary>make mode</primary>
-       </indexterm>
-       <indexterm><primary><option>--make</option></primary>
-       </indexterm>
-       <listitem>
-         <para>In this mode, GHC will build a multi-module Haskell
-         program automatically, figuring out dependencies for itself.
-         If you have a straightforward Haskell program, this is
-         likely to be much easier, and faster, than using
-         <command>make</command>.</para>
-       </listitem>
-      </varlistentry>
+  <para>GHC can work in one of three &ldquo;modes&rdquo;:</para>
+
+  <variablelist>
+    <varlistentry>
+      <term><cmdsynopsis><command>ghc</command>
+         <arg choice=plain>&ndash;&ndash;interactive</arg>
+       </cmdsynopsis></term>
+      <indexterm><primary>interactive mode</primary>
+      </indexterm>
+      <indexterm><primary>ghci</primary>
+      </indexterm>
+      <listitem>
+       <para>Interactive mode, which is also available as
+       <command>ghci</command>.  Interactive mode is described in
+       more detail in <xref linkend="ghci">.</para>
+      </listitem>
+    </varlistentry>
 
-      <varlistentry>
-       <term><cmdsynopsis>
-           <command>ghc</command>
-           <group>
-             <arg>-E</arg>
-             <arg>-C</arg>
-             <arg>-S</arg>
-             <arg>-c</arg>
-           </group>
-         </cmdsynopsis></term>
-       <indexterm><primary><option>--make</option></primary>
-       </indexterm>
-       <listitem>
-         <para>This is the traditional batch-compiler mode, in which
+    <varlistentry>
+      <term><cmdsynopsis><command>ghc</command>
+         <arg choice=plain>&ndash;&ndash;make</arg>
+       </cmdsynopsis></term>
+      <indexterm><primary>make mode</primary>
+      </indexterm>
+      <indexterm><primary><option>&ndash;&ndash;make</option></primary>
+      </indexterm>
+      <listitem>
+       <para>In this mode, GHC will build a multi-module Haskell
+       program automatically, figuring out dependencies for itself.
+       If you have a straightforward Haskell program, this is likely
+       to be much easier, and faster, than using
+       <command>make</command>.</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><cmdsynopsis>
+         <command>ghc</command>
+         <group>
+           <arg>-E</arg>
+           <arg>-C</arg>
+           <arg>-S</arg>
+           <arg>-c</arg>
+         </group>
+       </cmdsynopsis></term>
+      <indexterm><primary><option>-E</option></primary></indexterm>
+      <indexterm><primary><option>-C</option></primary></indexterm>
+      <indexterm><primary><option>-S</option></primary></indexterm>
+      <indexterm><primary><option>-c</option></primary></indexterm>
+      <listitem>
+       <para>This is the traditional batch-compiler mode, in which
          GHC can compile source files one at a time, or link objects
          together into an executable.</para>
-       </listitem>
-      </varlistentry>
-    </variablelist>
-
+      </listitem>
+    </varlistentry>
+  </variablelist>
+  
   <sect1>
     <title>Options overview</title>
     
@@ -250,10 +252,10 @@ module X where
 
     <variablelist>
       <varlistentry>
-       <term><literal>-help</literal></term>
-       <term><literal>-?</literal></term>
-       <indexterm><primary><literal>-?</literal></primary></indexterm>
-       <indexterm><primary><literal>-help</literal></primary></indexterm>
+       <term><option>&ndash;&ndash;help</option></term>
+       <term><option>-?</option></term>
+       <indexterm><primary><option>-?</option></primary></indexterm>
+       <indexterm><primary><option>&ndash;&ndash;help</option></primary></indexterm>
        <listitem>
          <para>Cause GHC to spew a long usage message to standard
           output and then exit.</para>
@@ -261,8 +263,8 @@ module X where
       </varlistentry>
 
       <varlistentry>
-       <term><literal>-v</literal></term>
-       <indexterm><primary><literal>-v</literal></primary></indexterm>
+       <term><option>-v</option></term>
+       <indexterm><primary><option>-v</option></primary></indexterm>
        <listitem>
          <para>The <option>-v</option> option makes GHC
           <emphasis>verbose</emphasis>: it reports its version number
@@ -279,7 +281,7 @@ module X where
       </varlistentry>
        
       <varlistentry>
-       <term><literal>-v</literal><replaceable>n</replaceable></term>
+       <term><option>-v</option><replaceable>n</replaceable></term>
        <indexterm><primary><option>-v</option></primary></indexterm>
        <listitem>
          <para>To provide more control over the compiler's verbosity,
@@ -290,7 +292,7 @@ module X where
          
          <variablelist>
            <varlistentry>
-             <term><literal>-v0</literal></term>
+             <term><option>-v0</option></term>
              <listitem>
                <para>Disable all non-essential messages (this is the
                default).</para>
@@ -298,17 +300,17 @@ module X where
            </varlistentry>
 
            <varlistentry>
-             <term><literal>-v1</literal></term>
+             <term><option>-v1</option></term>
              <listitem>
                <para>Minimal verbosity: print one line per
                compilation (this is the default when
-               <option>--make</option> or
-               <option>--interactive</option> is on).</para>
+               <option>&ndash;&ndash;make</option> or
+               <option>&ndash;&ndash;interactive</option> is on).</para>
              </listitem>
            </varlistentry>
 
            <varlistentry>
-             <term><literal>-v2</literal></term>
+             <term><option>-v2</option></term>
              <listitem>
                <para>Print the name of each compilation phase as it
                is executed. (equivalent to
@@ -317,7 +319,7 @@ module X where
            </varlistentry>
 
            <varlistentry>
-             <term><literal>-v3</literal></term>
+             <term><option>-v3</option></term>
              <listitem>
                <para>The same as <option>-v2</option>, except that in
                 addition the full command line (if appropriate) for
@@ -326,7 +328,7 @@ module X where
            </varlistentry>
 
            <varlistentry>
-             <term><literal>-v4</literal></term>
+             <term><option>-v4</option></term>
              <listitem>
                <para>The same as <option>-v3</option> except that the
                intermediate program representation after each
@@ -339,32 +341,50 @@ module X where
       </varlistentry>
       
       <varlistentry>
-       <term><literal>--version</literal></term>
-       <indexterm><primary><literal>--version</literal></primary></indexterm>
+       <term><option>-V</option></term>
+       <term><option>&ndash;&ndash;version</option></term>
+       <indexterm><primary><option>-V</option></primary></indexterm>
+       <indexterm><primary><option>&ndash;&ndash;version</option></primary></indexterm>
        <listitem>
          <para>Print a one-line string including GHC's version number.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
-       <term><literal>--numeric-version</literal></term>
-       <indexterm><primary><literal>--numeric-version</literal></primary></indexterm>
+       <term><option>&ndash;&ndash;numeric-version</option></term>
+       <indexterm><primary><option>&ndash;&ndash;numeric-version</option></primary></indexterm>
        <listitem>
          <para>Print GHC's numeric version number only.</para>
        </listitem>
       </varlistentry>
+
+      <varlistentry>
+       <term><option>&ndash;&ndash;print-libdir</option></term>
+       <indexterm><primary><option>&ndash;&ndash;print-libdir</option></primary></indexterm>
+       <listitem>
+         <para>Print the path to GHC's library directory.  This is
+         the top of the directory tree containing GHC's libraries,
+         interfaces, and include files (usually something like
+         <literal>/usr/local/lib/ghc-5.04</literal> on Unix).  This
+         is the value of
+         <literal>$libdir</literal><indexterm><primary><literal>libdir</literal></primary>
+         </indexterm>in the package configuration file (see <xref
+         linkend="packages">).</para>
+       </listitem>
+      </varlistentry>
+
     </variablelist>
   </sect1>
 
   <sect1 id="make-mode">
-    <title>Using <command>ghc</command> <option>--make</option></title>
+    <title>Using <command>ghc</command> <option>&ndash;&ndash;make</option></title>
 
-    <indexterm><primary><option>--make</option></primary>
+    <indexterm><primary><option>&ndash;&ndash;make</option></primary>
     </indexterm>
     <indexterm><primary>separate compilation</primary>
     </indexterm>
     
-    <para>When given the <option>--make</option> option, GHC will
+    <para>When given the <option>&ndash;&ndash;make</option> option, GHC will
     build a multi-module Haskell program by following dependencies
     from a single root module (usually <literal>Main</literal>).  For
     example, if your <literal>Main</literal> module is in a file
@@ -372,17 +392,17 @@ module X where
     the program like this:</para>
 
 <screen>
-ghc --make Main.hs
+ghc &ndash;&ndash;make Main.hs
 </screen>
 
-    <para>The command line must contain one source file or module
-    name; GHC will figure out all the modules in the program by
-    following the imports from this initial module.  It will then
-    attempt to compile each module which is out of date, and finally
-    if the top module is <literal>Main</literal>, the program
+    <para>The command line may contain any number of source file names
+    or module names; GHC will figure out all the modules in the
+    program by following the imports from these initial modules.  It
+    will then attempt to compile each module which is out of date, and
+    finally if there is a <literal>Main</literal> module, the program
     will also be linked into an executable.</para>
 
-    <para>The main advantages to using <literal>ghc --make</literal>
+    <para>The main advantages to using <literal>ghc &ndash;&ndash;make</literal>
     over traditional <literal>Makefile</literal>s are:</para>
 
     <itemizedlist>
@@ -390,7 +410,7 @@ ghc --make Main.hs
        <para>GHC doesn't have to be restarted for each compilation,
        which means it can cache information between compilations.
        Compiling a muli-module program with <literal>ghc
-       --make</literal> can be up to twice as fast as running
+       &ndash;&ndash;make</literal> can be up to twice as fast as running
        <literal>ghc</literal> individually on each source
        file.</para>
       </listitem>
@@ -408,7 +428,7 @@ ghc --make Main.hs
     </itemizedlist>
 
     <para>Any of the command-line options described in the rest of
-    this chapter can be used with <option>--make</option>, but note
+    this chapter can be used with <option>&ndash;&ndash;make</option>, but note
     that any options you give on the command line will apply to all
     the source files compiled, so if you want any options to apply to
     a single source file only, you'll need to use an
@@ -416,14 +436,28 @@ ghc --make Main.hs
     linkend="source-file-options">).</para>
 
     <para>If the program needs to be linked with additional objects
-    (say, some auxilliary C code), these can be specified on the
-    command line as usual.</para>
+    (say, some auxilliary C code), then the object files can be
+    given on the command line and GHC will include them when linking
+    the executable.</para>
+
+    <para>Note that GHC can only follow dependencies if it has the
+    source file available, so if your program includes a module for
+    which there is no source file, even if you have an object and an
+    interface file for the module, then GHC will complain.  The
+    exception to this rule is for package modules, which may or may
+    not have source files.</para>
+
+    <para>The source files for the program don't all need to be in the
+    same directory; the <option>-i</option> option can be used to add
+    directories to the search path (see <xref
+    linkend="search-path">).</para>
+
   </sect1>
   
   <Sect1 id="options-order">
-    <title>GHC without <option>--make</option></title>
+    <title>GHC without <option>&ndash;&ndash;make</option></title>
 
-    <para>Without <option>--make</option>, GHC will compile one or
+    <para>Without <option>&ndash;&ndash;make</option>, GHC will compile one or
     more source files given on the command line.</para>
 
     <para>The first phase to run is determined by each input-file
@@ -520,220 +554,7 @@ ghc --make Main.hs
     standard output.</para>
   </sect1>
 
-  <sect1 id="options-output">
-    <title>Re-directing the compilation output(s)</title>
-
-    <indexterm><primary>output-directing options</primary></indexterm>
-    <indexterm><primary>redirecting compilation output</primary></indexterm>
-
-
-    <variablelist>
-      <varlistentry>
-       <term><literal>-o</literal></term>
-       <indexterm><primary><literal>-o</literal></primary></indexterm>
-       <listitem>
-         <para>GHC's compiled output normally goes into a
-          <filename>.hc</filename>, <filename>.o</filename>, etc.,
-          file, depending on the last-run compilation phase.  The
-          option <option>-o foo</option><IndexTerm><Primary>-o
-          option</Primary></IndexTerm> re-directs the output of that
-          last-run phase to file <filename>foo</filename>.</para>
-
-         <para>Note: this &ldquo;feature&rdquo; can be
-          counterintuitive: <command>ghc -C -o foo.o foo.hs</command>
-          will put the intermediate C code in the file
-          <filename>foo.o</filename>, name notwithstanding!</para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term><literal>-odir</literal></term>
-       <indexterm><primary><literal>-odir</literal></primary></indexterm>
-       <listitem>
-         <para>The <option>-o</option> option isn't of much use if
-          you have <emphasis>several</emphasis> input files&hellip;
-          Non-interface output files are normally put in the same
-          directory as their corresponding input file came from.  You
-          may specify that they be put in another directory using the
-          <option>-odir &lt;dir&gt;</option><IndexTerm><Primary>-odir
-          &lt;dir&gt; option</Primary></IndexTerm> (the &ldquo;Oh,
-          dear&rdquo; option).  For example:</para>
-
-<Screen>
-% ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
-</Screen>
-
-          <para>The output files, <filename>Foo.o</filename>,
-          <filename>Bar.o</filename>, and
-          <filename>Bumble.o</filename> would be put into a
-          subdirectory named after the architecture of the executing
-          machine (<filename>sun4</filename>,
-          <filename>mips</filename>, etc).  The directory must already
-          exist; it won't be created.</para>
-
-          <para>Note that the <option>-odir</option> option does
-          <emphasis>not</emphasis> affect where the interface files
-          are put.  In the above example, they would still be put in
-          <filename>parse/Foo.hi</filename>,
-          <filename>parse/Bar.hi</filename>, and
-          <filename>gurgle/Bumble.hi</filename>.</para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term><literal>-ohi</literal></term>
-       <indexterm><primary><literal>-ohi</literal></primary></indexterm>
-       <listitem>
-         <para></para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term><literal>-osuf</literal></term>
-       <term><literal>-hisuf</literal></term>
-       <indexterm><primary><literal>-osuf</literal></primary></indexterm>
-       <indexterm><primary><literal>-hisuf</literal></primary></indexterm>
-       <listitem>
-         <para>EXOTICA: The <option>-osuf
-          &lt;suffix&gt;</option><IndexTerm><Primary>-osuf
-          &lt;suffix&gt; option</Primary></IndexTerm> will change the
-          <filename>.o</filename> file suffix for object files to
-          whatever you specify.  (We use this in compiling the
-          prelude.).</para>
-
-         <para>Similarly, the <option>-hisuf
-          &lt;suffix&gt;</option><IndexTerm><Primary>-hisuf
-          &lt;suffix&gt; option</Primary></IndexTerm> will change the
-          <filename>.hi</filename> file suffix for non-system
-          interface files (see <XRef LinkEnd="hi-options">).</para>
-
-         <para>The <option>-hisuf</option>/<option>-osuf</option>
-          game is useful if you want to compile a program with both
-          GHC and HBC (say) in the same directory.  Let HBC use the
-          standard <filename>.hi</filename>/<filename>.o</filename>
-          suffixes; add <option>-hisuf g&lowbar;hi -osuf
-          g&lowbar;o</option> to your <command>make</command> rule for
-          GHC compiling&hellip;</para>
-       </listitem>
-      </varlistentry>
-    </variablelist>
-       
-    <sect2 id="keeping-intermediates">
-      <title>Keeping Intermediate Files</title>
-      <indexterm><primary>intermediate files, saving</primary>
-      </indexterm>
-      <indexterm><primary><literal>.hc</literal> files, saving</primary>
-      </indexterm>
-      <indexterm><primary><literal>.s</literal> files, saving</primary>
-      </indexterm>
-
-
-      <para>The following options are useful for keeping certain
-      intermediate files around, when normally GHC would throw these
-      away after compilation:</para>
-
-      <variablelist>
-       <varlistentry>
-         <term><literal>-keep-hc-files</literal></term>
-         <indexterm>
-           <primary><literal>-keep-hc-files</literal></primary>
-         </indexterm>
-         <listitem>
-           <para>Keep intermediate <literal>.hc</literal> files when
-           doing <literal>.hs</literal>-to-<literal>.o</literal>
-           compilations via C (NOTE: <literal>.hc</literal> files
-           aren't generated when using the native code generator, you
-           may need to use <literal>-fvia-C</literal> to force them
-           to be produced).</para>
-         </listitem>
-       </varlistentry>
-
-       <varlistentry>
-         <term><literal>-keep-s-files</literal></term>
-         <indexterm>
-           <primary><literal>-keep-s-files</literal></primary>
-         </indexterm>
-         <listitem>
-           <para>Keep intermediate <literal>.s</literal> files.</para>
-         </listitem>
-       </varlistentry>
-
-       <varlistentry>
-         <term><literal>-keep-raw-s-files</literal></term>
-         <indexterm>
-           <primary><literal>-keep-raw-s-files</literal></primary>
-         </indexterm>
-         <listitem>
-           <para>Keep intermediate <literal>.raw-s</literal> files.
-           These are the direct output from the C compiler, before
-           GHC does &ldquo;assembly mangling&rdquo; to produce the
-           <literal>.s</literal> file.  Again, these are not produced
-           when using the native code generator.</para>
-         </listitem>
-       </varlistentry>
-
-       <varlistentry>
-         <term><literal>-keep-tmp-files</literal></term>
-         <indexterm>
-           <primary><literal>-keep-tmp-files</literal></primary>
-         </indexterm>
-         <indexterm>
-           <primary>temporary files</primary>
-           <secondary>keeping</secondary>
-         </indexterm>
-         <listitem>
-           <para>Instructs the GHC driver not to delete any of its
-           temporary files, which it normally keeps in
-           <literal>/tmp</literal> (or possibly elsewhere; see <xref
-           linkend="temp-files">).  Running GHC with
-           <literal>-v</literal> will show you what temporary files
-           were generated along the way.</para>
-         </listitem>
-       </varlistentry>
-      </variablelist>
-    </sect2>
-
-    <sect2 id="temp-files">
-      <title>Redirecting temporary files</title>
-
-      <indexterm>
-       <primary>temporary files</primary>
-       <secondary>redirecting</secondary>
-      </indexterm>
-
-      <variablelist>
-       <varlistentry>
-         <term><literal>-tmpdir</literal></term>
-         <indexterm><primary><literal>-tmpdir</literal></primary></indexterm>
-         <listitem>
-           <para>If you have trouble because of running out of space
-            in <filename>/tmp</filename> (or wherever your
-            installation thinks temporary files should go), you may
-            use the <option>-tmpdir
-            &lt;dir&gt;</option><IndexTerm><Primary>-tmpdir
-            &lt;dir&gt; option</Primary></IndexTerm> option to specify
-            an alternate directory.  For example, <option>-tmpdir
-            .</option> says to put temporary files in the current
-            working directory.</para>
-
-           <para>Alternatively, use your <Constant>TMPDIR</Constant>
-            environment variable.<IndexTerm><Primary>TMPDIR
-            environment variable</Primary></IndexTerm> Set it to the
-            name of the directory where temporary files should be put.
-            GCC and other programs will honour the
-            <Constant>TMPDIR</Constant> variable as well.</para>
-
-           <para>Even better idea: Set the
-            <Constant>DEFAULT_TMPDIR</Constant> make variable when
-            building GHC, and never worry about
-            <Constant>TMPDIR</Constant> again. (see the build
-            documentation).</para>
-         </listitem>
-       </varlistentry>
-      </variablelist>
-    </sect2>
-
-  </sect1>
+  &separate;
 
   <sect1 id="options-sanity">
     <title>Warnings and sanity-checking</title>
@@ -747,7 +568,7 @@ ghc --make Main.hs
     generated during compilation.  By default, you get a standard set
     of warnings which are generally likely to indicate bugs in your
     program.  These are:
-    <option>-fwarn-overlpapping-patterns</option>,
+    <option>-fwarn-overlapping-patterns</option>,
     <option>-fwarn-deprecations</option>,
     <option>-fwarn-duplicate-exports</option>,
     <option>-fwarn-missing-fields</option>, and
@@ -764,7 +585,8 @@ ghc --make Main.hs
          <para>Provides the standard warnings plus
          <option>-fwarn-incomplete-patterns</option>,
          <option>-fwarn-unused-matches</option>,
-         <option>-fwarn-unused-imports</option> and
+         <option>-fwarn-unused-imports</option>,
+         <option>-fwarn-misc</option>, and
          <option>-fwarn-unused-binds</option>.</para>
        </listitem>
       </varlistentry>
@@ -772,7 +594,7 @@ ghc --make Main.hs
       <varlistentry>
        <term><option>-w</option>:</term>
        <listitem>
-         <IndexTerm><Primary>-w option</Primary></IndexTerm>
+         <IndexTerm><Primary><option>-w</option></Primary></IndexTerm>
          <para>Turns off all warnings, including the standard ones.</para>
        </listitem>
       </varlistentry>
@@ -780,11 +602,20 @@ ghc --make Main.hs
       <varlistentry>
        <term><option>-Wall</option>:</term>
        <listitem>
-         <indexterm><primary>-Wall option</primary></indexterm>
+         <indexterm><primary><option>-Wall</option></primary></indexterm>
          <para>Turns on all warning options.</para>
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term><option>-Werror</option>:</term>
+       <listitem>
+         <indexterm><primary><option>-Werror</option></primary></indexterm>
+         <para>Makes any warning into a fatal error. Useful so that you don't 
+           miss warnings when doing batch compilation. </para>
+       </listitem>
+      </varlistentry>
+
     </variablelist>
 
     <para>The full set of warning options is described below.  To turn
@@ -809,7 +640,7 @@ ghc --make Main.hs
       <varlistentry>
        <term><option>-fwarn-duplicate-exports</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-duplicate-exports option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-duplicate-exports</option></primary></indexterm>
          <indexterm><primary>duplicate exports, warning</primary></indexterm>
          <indexterm><primary>export lists, duplicates</primary></indexterm>
 
@@ -826,7 +657,7 @@ ghc --make Main.hs
       <varlistentry>
        <term><option>-fwarn-hi-shadowing</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-hi-shadowing option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-hi-shadowing</option></primary></indexterm>
          <indexterm><primary>shadowing</primary>
            <secondary>interface files</secondary></indexterm>
 
@@ -840,7 +671,7 @@ ghc --make Main.hs
       <varlistentry>
        <term><option>-fwarn-incomplete-patterns</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-incomplete-patterns option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-incomplete-patterns</option></primary></indexterm>
          <indexterm><primary>incomplete patterns, warning</primary></indexterm>
          <indexterm><primary>patterns, incomplete</primary></indexterm>
 
@@ -862,9 +693,20 @@ g [] = 2
       </varlistentry>
 
       <varlistentry>
+       <term><option>-fwarn-misc</option>:</term>
+       <indexterm><primary><option>-fwarn-misc</option></primary></indexterm>
+       <listitem>
+         <para>Turns on warnings for various harmless but untidy
+         things.  This currently includes: importing a type with
+         <literal>(..)</literal> when the export is abstract, and
+         listing duplicate class assertions in a qualified type.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term><option>-fwarn-missing-fields</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-missing-fields option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-missing-fields</option></primary></indexterm>
          <indexterm><primary>missing fields, warning</primary></indexterm>
          <indexterm><primary>fields, missing</primary></indexterm>
 
@@ -879,7 +721,7 @@ g [] = 2
       <varlistentry>
        <term><option>-fwarn-missing-methods</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-missing-methods option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-missing-methods</option></primary></indexterm>
          <indexterm><primary>missing methods, warning</primary></indexterm>
          <indexterm><primary>methods, missing</primary></indexterm>
 
@@ -887,13 +729,25 @@ g [] = 2
           an instance declaration is missing one or more methods, and
           the corresponding class declaration has no default
           declaration for them.</para>
+         <para>The warning is suppressed if the method name
+         begins with an underscore.  Here's an example where this is useful:
+           <programlisting>
+             class C a where
+               _simpleFn :: a -> String
+               complexFn :: a -> a -> String
+               complexFn x y = ... _simpleFn ...
+             </programlisting>
+           The idea is that: (a) users of the class will only call <literal>complexFn</literal>; 
+           never <literal>_simpleFn</literal>; and (b)
+           instance declarations can define either <literal>complexFn</literal> or <literal>_simpleFn</literal>.
+           </para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term><option>-fwarn-missing-signatures</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-missing-signatures option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-missing-signatures</option></primary></indexterm>
          <indexterm><primary>type signatures, missing</primary></indexterm>
 
          <para>If you would like GHC to check that every top-level
@@ -906,7 +760,7 @@ g [] = 2
       <varlistentry>
        <term><option>-fwarn-name-shadowing</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-name-shadowing option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-name-shadowing</option></primary></indexterm>
          <indexterm><primary>shadowing, warning</primary></indexterm>
          
          <para>This option causes a warning to be emitted whenever an
@@ -924,7 +778,7 @@ g [] = 2
 
       <varlistentry>
        <term><option>-fwarn-overlapping-patterns</option>:</term>
-       <indexterm><primary>-fwarn-overlapping-patterns option</primary></indexterm>
+       <indexterm><primary><option>-fwarn-overlapping-patterns</option></primary></indexterm>
        <indexterm><primary>overlapping patterns, warning</primary></indexterm>
        <indexterm><primary>patterns, overlapping</primary></indexterm>
        <listitem>
@@ -954,13 +808,27 @@ f "2"    = 2
          patterns that can fail, eg. <literal>\(x:xs)->...</literal>.
          Normally, these aren't treated as incomplete patterns by
          <option>-fwarn-incomplete-patterns</option>.</para>
+         <para>``Lambda-bound patterns'' includes all places where there is a single pattern,
+           including list comprehensions and do-notation.  In these cases, a pattern-match 
+           failure is quite legitimate, and triggers filtering (list comprehensions) or
+           the monad <literal>fail</literal> operation (monads). For example:
+           <programlisting>
+             f :: [Maybe a] -> [a]
+             f xs = [y | Just y <- xs]
+             </programlisting>
+           Switching on <option>-fwarn-simple-patterns</option> will elicit warnings about
+           these probably-innocent cases, which is why the flag is off by default. </para>
+         <para> The <literal>deriving( Read )</literal> mechanism produces monadic code with
+           pattern matches, so you will also get misleading warnings about the compiler-generated
+           code.  (This is arguably a Bad Thing, but it's awkward to fix.)</para>
+
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term><option>-fwarn-type-defaults</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-type-defaults option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-type-defaults</option></primary></indexterm>
          <indexterm><primary>defaulting mechanism, warning</primary></indexterm>
          <para>Have the compiler warn/inform you where in your source
           the Haskell defaulting mechanism for numeric types kicks
@@ -980,7 +848,7 @@ f "2"    = 2
       <varlistentry>
        <term><option>-fwarn-unused-binds</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-unused-binds option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-unused-binds</option></primary></indexterm>
          <indexterm><primary>unused binds, warning</primary></indexterm>
          <indexterm><primary>binds, unused</primary></indexterm>
          <para>Report any function definitions (and local bindings)
@@ -992,7 +860,7 @@ f "2"    = 2
       <varlistentry>
        <term><option>-fwarn-unused-imports</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-unused-imports option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-unused-imports</option></primary></indexterm>
          <indexterm><primary>unused imports, warning</primary></indexterm>
          <indexterm><primary>imports, unused</primary></indexterm>
 
@@ -1004,30 +872,33 @@ f "2"    = 2
       <varlistentry>
        <term><option>-fwarn-unused-matches</option>:</term>
        <listitem>
-         <indexterm><primary>-fwarn-unused-matches option</primary></indexterm>
+         <indexterm><primary><option>-fwarn-unused-matches</option></primary></indexterm>
          <indexterm><primary>unused matches, warning</primary></indexterm>
          <indexterm><primary>matches, unused</primary></indexterm>
 
          <para>Report all unused variables which arise from pattern
           matches, including patterns consisting of a single variable.
           For instance <literal>f x y = []</literal> would report
-          <VarName>x</VarName> and <VarName>y</VarName> as unused.  To
-          eliminate the warning, all unused variables can be replaced
-          with wildcards.</para>
+          <VarName>x</VarName> and <VarName>y</VarName> as unused.  The
+          warning is suppressed if the variable name begins with an underscore, thus:
+           <programlisting>
+              f _x = True
+           </programlisting>
+          </para>
        </listitem>
       </varlistentry>
 
     </VariableList>
 
     <para>If you're feeling really paranoid, the
-    <option>-dcore-lint</option> option<indexterm><primary>-dcore-lint
-    option</primary></indexterm> is a good choice.  It turns on
-    heavyweight intra-pass sanity-checking within GHC.  (It checks
-    GHC's sanity, not yours.)</para>
+    <option>-dcore-lint</option>
+    option<indexterm><primary><option>-dcore-lint</option></primary></indexterm>
+    is a good choice.  It turns on heavyweight intra-pass
+    sanity-checking within GHC.  (It checks GHC's sanity, not
+    yours.)</para>
 
   </sect1>
 
-  &separate;
   &packages;
 
   <sect1 id="options-optimise">
@@ -1121,18 +992,6 @@ f "2"    = 2
        </varlistentry>
 
        <varlistentry>
-         <term><option>-O2-for-C</option>:</term>
-         <indexterm><primary>-O2-for-C option</primary></indexterm>
-         <indexterm><primary>gcc, invoking with -O2</primary></indexterm>
-         <listitem>
-           <para>Says to run GCC with <option>-O2</option>, which may
-            be worth a few percent in execution speed.  Don't forget
-            <option>-fvia-C</option>, lest you use the native-code
-            generator and bypass GCC altogether!</para>
-         </listitem>
-       </varlistentry>
-
-       <varlistentry>
          <term><option>-Ofile &lt;file&gt;</option>:</term>
          <indexterm><primary>-Ofile &lt;file&gt; option</primary></indexterm>
          <indexterm><primary>optimising, customised</primary></indexterm>
@@ -1159,8 +1018,8 @@ f "2"    = 2
       <para>We don't use a <option>-O*</option> flag for day-to-day
       work.  We use <option>-O</option> to get respectable speed;
       e.g., when we want to measure something.  When we want to go for
-      broke, we tend to use <option>-O -fvia-C -O2-for-C</option> (and
-      we go for lots of coffee breaks).</para>
+      broke, we tend to use <option>-O -fvia-C</option> (and we go for
+      lots of coffee breaks).</para>
 
       <para>The easiest way to see what <option>-O</option> (etc.)
       &ldquo;really mean&rdquo; is to run with <option>-v</option>,
@@ -1196,6 +1055,20 @@ f "2"    = 2
        </varlistentry>
 
        <varlistentry>
+         <term><option>-fignore-asserts</option>:</term>
+         <listitem>
+           <indexterm><primary><option>-fignore-asserts</option></primary></indexterm>
+           <para>Causes GHC to ignore uses of the function
+           <literal>Exception.assert</literal> in source code (in
+           other words, rewriting <literal>Exception.assert p
+           e</literal> to <literal>e</literal> (see <xref
+           linkend="sec-assertions">).  This flag is turned on by
+           <option>-O</option>.
+           </para>
+         </listitem>
+       </varlistentry>
+
+       <varlistentry>
          <term><option>-fno-strictness</option></term>
          <indexterm><primary><option>-fno-strictness</option></primary>
          </indexterm>
@@ -1305,9 +1178,10 @@ data S = S !Int !Int
             at a call site. A bigger function would be assigned a
             bigger cost.) </para>
 
-           <para> Consequences: (a) nothing larger than
-           this will be inlined (unless it has an INLINE pragma); (b) nothing larger
-           than this will be spewed into an interface file. </para>
+           <para> Consequences: (a) nothing larger than this will be
+           inlined (unless it has an INLINE pragma); (b) nothing
+           larger than this will be spewed into an interface
+           file. </para>
 
 
             <para> Increasing this figure is more likely to result in longer
@@ -1334,36 +1208,31 @@ data S = S !Int !Int
       </variablelist>
 
     </sect2>
-
+    
   </sect1>
-
-&phases;  
-
-<Sect1 id="sec-using-concurrent">
+  
+  &phases;  
+  
+  <sect1 id="sec-using-concurrent">
 <title>Using Concurrent Haskell</title>
 
-<para>
-<indexterm><primary>Concurrent Haskell&mdash;use</primary></indexterm>
-</para>
+            <indexterm><primary>Concurrent Haskell&mdash;use</primary></indexterm>
 
 <para>
-GHC (as of version 4.00) supports Concurrent Haskell by default,
-without requiring a special option or libraries compiled in a certain
-way.  To get access to the support libraries for Concurrent Haskell
-(i.e. <literal>Concurrent</literal> and friends), use the
-<option>-package concurrent</option> option.
-</para>
+GHC supports Concurrent Haskell by default, without requiring a
+special option or libraries compiled in a certain way.  To get access
+to the support libraries for Concurrent Haskell, just import
+<literal>Control.Concurrent</literal> (details are in the accompanying
+library documentation).</para>
 
 <para>
-Three RTS options are provided for modifying the behaviour of the
-threaded runtime system.  See the descriptions of
-<option>-C[&lt;us&gt;]</option>, <option>-q</option>, and
-<option>-t&lt;num&gt;</option> in <XRef LinkEnd="parallel-rts-opts">.
+RTS options are provided for modifying the behaviour of the threaded
+runtime system.  See <XRef LinkEnd="parallel-rts-opts">.
 </para>
 
 <para>
-Concurrent Haskell is described in more detail in <XRef
-LinkEnd="sec-Concurrent">.
+Concurrent Haskell is described in more detail in the documentation
+for the <literal>Control.Concurrent</literal> module.
 </para>
 
 </Sect1>
@@ -1377,21 +1246,21 @@ LinkEnd="sec-Concurrent">.
 
 <para>
 &lsqb;You won't be able to execute parallel Haskell programs unless PVM3
-(Parallel Virtual Machine, version 3) is installed at your site.]
-</para>
+(Parallel Virtual Machine, version 3) is installed at your site.&rsqb;
+</Para>
 
 <para>
 To compile a Haskell program for parallel execution under PVM, use the
-<option>-parallel</option> option,<indexterm><primary>-parallel
-option</primary></indexterm> both when compiling <emphasis>and
-linking</emphasis>.  You will probably want to <literal>import
-Parallel</literal> into your Haskell modules.
-</para>
+<Option>-parallel</Option> option,<IndexTerm><Primary>-parallel
+option</Primary></IndexTerm> both when compiling <Emphasis>and
+linking</Emphasis>.  You will probably want to <Literal>import
+Parallel</Literal> into your Haskell modules.
+</Para>
 
 <para>
 To run your parallel program, once PVM is going, just invoke it
 &ldquo;as normal&rdquo;.  The main extra RTS option is
-<option>-N&lt;n&gt;</option>, to say how many PVM
+<Option>-qp&lt;n&gt;</Option>, to say how many PVM
 &ldquo;processors&rdquo; your program to run on.  (For more details of
 all relevant RTS options, please see <XRef
 LinkEnd="parallel-rts-opts">.)
@@ -1403,8 +1272,8 @@ out of them (e.g., parallelism profiles) is a battle with the vagaries of
 PVM, detailed in the following sections.
 </para>
 
-<sect2>
-<title>Dummy's guide to using PVM</title>
+<Sect2 id="pvm-dummies">
+<Title>Dummy's guide to using PVM</Title>
 
 <para>
 <indexterm><primary>PVM, how to use</primary></indexterm>
@@ -1423,11 +1292,23 @@ setenv PVM_DPATH $PVM_ROOT/lib/pvmd
 
 <para>
 Creating and/or controlling your &ldquo;parallel machine&rdquo; is a purely-PVM
-business; nothing specific to Parallel Haskell.
-</para>
+business; nothing specific to Parallel Haskell. The following paragraphs
+describe how to configure your parallel machine interactively.
+</Para>
 
-<para>
-You use the <command>pvm</command><indexterm><primary>pvm command</primary></indexterm> command to start PVM on your
+<Para>
+If you use parallel Haskell regularly on the same machine configuration it
+is a good idea to maintain a file with all machine names and to make the
+environment variable PVM_HOST_FILE point to this file. Then you can avoid
+the interactive operations described below by just saying
+</Para>
+
+<ProgramListing>
+pvm $PVM_HOST_FILE
+</ProgramListing>
+
+<Para>
+You use the <Command>pvm</Command><IndexTerm><Primary>pvm command</Primary></IndexTerm> command to start PVM on your
 machine.  You can then do various things to control/monitor your
 &ldquo;parallel machine;&rdquo; the most useful being:
 </para>
@@ -1489,8 +1370,8 @@ The PVM documentation can tell you much, much more about <command>pvm</command>!
 
 </sect2>
 
-<sect2>
-<title>Parallelism profiles</title>
+<Sect2 id="par-profiles">
+<Title>Parallelism profiles</Title>
 
 <para>
 <indexterm><primary>parallelism profiles</primary></indexterm>
@@ -1503,25 +1384,25 @@ With Parallel Haskell programs, we usually don't care about the
 results&mdash;only with &ldquo;how parallel&rdquo; it was!  We want pretty pictures.
 </para>
 
-<para>
-Parallelism profiles (&agrave; la <command>hbcpp</command>) can be generated with the
-<option>-q</option><indexterm><primary>-q RTS option (concurrent, parallel)</primary></indexterm> RTS option.  The
+<Para>
+Parallelism profiles (&agrave; la <Command>hbcpp</Command>) can be generated with the
+<Option>-qP</Option><IndexTerm><Primary>-qP RTS option (concurrent, parallel)</Primary></IndexTerm> RTS option.  The
 per-processor profiling info is dumped into files named
-<filename>&lt;full-path&gt;&lt;program&gt;.gr</filename>.  These are then munged into a PostScript picture,
+<Filename>&lt;full-path&gt;&lt;program&gt;.gr</Filename>.  These are then munged into a PostScript picture,
 which you can then display.  For example, to run your program
-<filename>a.out</filename> on 8 processors, then view the parallelism profile, do:
-</para>
+<Filename>a.out</Filename> on 8 processors, then view the parallelism profile, do:
+</Para>
 
-<para>
+<Para>
 
 <Screen>
-% ./a.out +RTS -N8 -q
-% grs2gr *.???.gr &#62; temp.gr     # combine the 8 .gr files into one
-% gr2ps -O temp.gr              # cvt to .ps; output in temp.ps
-% ghostview -seascape temp.ps   # look at it!
+<prompt>&dollar;</prompt> ./a.out +RTS -qP -qp8
+<prompt>&dollar;</prompt> grs2gr *.???.gr &#62; temp.gr # combine the 8 .gr files into one
+<prompt>&dollar;</prompt> gr2ps -O temp.gr              # cvt to .ps; output in temp.ps
+<prompt>&dollar;</prompt> ghostview -seascape temp.ps   # look at it!
 </Screen>
 
-</para>
+</Para>
 
 <para>
 The scripts for processing the parallelism profiles are distributed
@@ -1530,13 +1411,13 @@ in <filename>ghc/utils/parallel/</filename>.
 
 </sect2>
 
-<sect2>
-<title>Other useful info about running parallel programs</title>
+<Sect2>
+<Title>Other useful info about running parallel programs</Title>
 
-<para>
+<Para>
 The &ldquo;garbage-collection statistics&rdquo; RTS options can be useful for
 seeing what parallel programs are doing.  If you do either
-<option>+RTS -Sstderr</option><indexterm><primary>-Sstderr RTS option</primary></indexterm> or <option>+RTS -sstderr</option>, then
+<Option>+RTS -Sstderr</Option><IndexTerm><Primary>-Sstderr RTS option</Primary></IndexTerm> or <Option>+RTS -sstderr</Option>, then
 you'll get mutator, garbage-collection, etc., times on standard
 error. The standard error of all PE's other than the `main thread'
 appears in <filename>/tmp/pvml.nnn</filename>, courtesy of PVM.
@@ -1569,12 +1450,12 @@ for concurrent/parallel execution.
 <para>
 <VariableList>
 
-<varlistentry>
-<term><option>-N&lt;N&gt;</option>:</term>
-<listitem>
-<para>
-<indexterm><primary>-N&lt;N&gt; RTS option (parallel)</primary></indexterm>
-(PARALLEL ONLY) Use <literal>&lt;N&gt;</literal> PVM processors to run this program;
+<VarListEntry>
+<Term><Option>-qp&lt;N&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qp&lt;N&gt; RTS option</Primary></IndexTerm>
+(PARALLEL ONLY) Use <Literal>&lt;N&gt;</Literal> PVM processors to run this program;
 the default is 2.
 </para>
 </listitem>
@@ -1608,60 +1489,98 @@ records the movement of threads between the green (runnable) and red
 green queue is split into green (for the currently running thread
 only) and amber (for other runnable threads).  We do not recommend
 that you use the verbose suboption if you are planning to use the
-<command>hbcpp</command> profiling tools or if you are context switching at every heap
-check (with <option>-C</option>).
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><option>-t&lt;num&gt;</option>:</term>
-<listitem>
-<para>
-<indexterm><primary>-t&lt;num&gt; RTS option</primary></indexterm>
-(PARALLEL ONLY) Limit the number of concurrent threads per processor
-to <literal>&lt;num&gt;</literal>.  The default is 32.  Each thread requires slightly over 1K
-<emphasis>words</emphasis> in the heap for thread state and stack objects.  (For
-32-bit machines, this translates to 4K bytes, and for 64-bit machines,
-8K bytes.)
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><option>-d</option>:</term>
-<listitem>
-<para>
-<indexterm><primary>-d RTS option (parallel)</primary></indexterm>
+<Command>hbcpp</Command> profiling tools or if you are context switching at every heap
+check (with <Option>-C</Option>).
+-->
+</Para>
+</ListItem>
+</VarListEntry>
+<VarListEntry>
+<Term><Option>-qt&lt;num&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qt&lt;num&gt; RTS option</Primary></IndexTerm>
+(PARALLEL ONLY) Limit the thread pool size, i.e. the number of concurrent
+threads per processor to <Literal>&lt;num&gt;</Literal>.  The default is
+32.  Each thread requires slightly over 1K <Emphasis>words</Emphasis> in
+the heap for thread state and stack objects.  (For 32-bit machines, this
+translates to 4K bytes, and for 64-bit machines, 8K bytes.)
+</Para>
+</ListItem>
+</VarListEntry>
+<!-- no more -HWL
+<VarListEntry>
+<Term><Option>-d</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-d RTS option (parallel)</Primary></IndexTerm>
 (PARALLEL ONLY) Turn on debugging.  It pops up one xterm (or GDB, or
-something&hellip;) per PVM processor.  We use the standard <command>debugger</command>
+something&hellip;) per PVM processor.  We use the standard <Command>debugger</Command>
 script that comes with PVM3, but we sometimes meddle with the
-<command>debugger2</command> script.  We include ours in the GHC distribution,
-in <filename>ghc/utils/pvm/</filename>.
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><option>-e&lt;num&gt;</option>:</term>
-<listitem>
-<para>
-<indexterm><primary>-e&lt;num&gt; RTS option (parallel)</primary></indexterm>
-(PARALLEL ONLY) Limit the number of pending sparks per processor to
-<literal>&lt;num&gt;</literal>. The default is 100. A larger number may be appropriate if
-your program generates large amounts of parallelism initially.
-</para>
-</listitem>
-</varlistentry>
-<varlistentry>
-<term><option>-Q&lt;num&gt;</option>:</term>
-<listitem>
-<para>
-<indexterm><primary>-Q&lt;num&gt; RTS option (parallel)</primary></indexterm>
+<Command>debugger2</Command> script.  We include ours in the GHC distribution,
+in <Filename>ghc/utils/pvm/</Filename>.
+</Para>
+</ListItem>
+</VarListEntry>
+-->
+<VarListEntry>
+<Term><Option>-qe&lt;num&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qe&lt;num&gt; RTS option
+(parallel)</Primary></IndexTerm> (PARALLEL ONLY) Limit the spark pool size
+i.e. the number of pending sparks per processor to
+<Literal>&lt;num&gt;</Literal>. The default is 100. A larger number may be
+appropriate if your program generates large amounts of parallelism
+initially.
+</Para>
+</ListItem>
+</VarListEntry>
+<VarListEntry>
+<Term><Option>-qQ&lt;num&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qQ&lt;num&gt; RTS option (parallel)</Primary></IndexTerm>
 (PARALLEL ONLY) Set the size of packets transmitted between processors
-to <literal>&lt;num&gt;</literal>. The default is 1024 words. A larger number may be
+to <Literal>&lt;num&gt;</Literal>. The default is 1024 words. A larger number may be
 appropriate if your machine has a high communication cost relative to
 computation speed.
-</para>
-</listitem>
-</varlistentry>
+</Para>
+</ListItem>
+</VarListEntry>
+<VarListEntry>
+<Term><Option>-qh&lt;num&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qh&lt;num&gt; RTS option (parallel)</Primary></IndexTerm>
+(PARALLEL ONLY) Select a packing scheme. Set the number of non-root thunks to pack in one packet to
+&lt;num&gt;-1 (0 means infinity). By default GUM uses full-subgraph
+packing, i.e. the entire subgraph with the requested closure as root is
+transmitted (provided it fits into one packet). Choosing a smaller value
+reduces the amount of pre-fetching of work done in GUM. This can be
+advantageous for improving data locality but it can also worsen the balance
+of the load in the system. 
+</Para>
+</ListItem>
+</VarListEntry>
+<VarListEntry>
+<Term><Option>-qg&lt;num&gt;</Option>:</Term>
+<ListItem>
+<Para>
+<IndexTerm><Primary>-qg&lt;num&gt; RTS option
+(parallel)</Primary></IndexTerm> (PARALLEL ONLY) Select a globalisation
+scheme. This option affects the
+generation of global addresses when transferring data. Global addresses are
+globally unique identifiers required to maintain sharing in the distributed
+graph structure. Currently this is a binary option. With &lt;num&gt;=0 full globalisation is used
+(default). This means a global address is generated for every closure that
+is transmitted. With &lt;num&gt;=1 a thunk-only globalisation scheme is
+used, which generated global address only for thunks. The latter case may
+lose sharing of data but has a reduced overhead in packing graph structures
+and maintaining internal tables of global addresses.
+</Para>
+</ListItem>
+</VarListEntry>
 </VariableList>
 </para>
 
@@ -1719,6 +1638,48 @@ statements or clauses.
   </sect1>
 
 &runtime;
+
+<sect1 id="ext-core">
+  <title>Generating and compiling External Core Files</title>
+
+  <indexterm><primary>intermediate code generation</primary></indexterm>
+
+  <para>GHC can dump its optimized intermediate code (said to be in &ldquo;Core&rdquo; format) 
+  to a file as a side-effect of compilation. Core files, which are given the suffix
+  <filename>.hcr</filename>, can be read and processed by non-GHC back-end
+  tools.  The Core format is formally described in <ulink url="http://www.haskell.org/ghc/docs/papers/core.ps.gz"
+  <citetitle>An External Representation for the GHC Core Language</citetitle></ulink>, 
+  and sample tools (in Haskell)
+  for manipulating Core files are available in the GHC source distribution 
+  directory <literal>/fptools/ghc/utils/ext-core</literal>.  
+  Note that the format of <literal>.hcr</literal> 
+  files is <emphasis>different</emphasis> (though similar) to the Core output format generated 
+  for debugging purposes (<xref linkend="options-debugging">).</para>
+
+  <para>The Core format natively supports notes which you can add to
+  your source code using the <literal>CORE</literal> pragma (see <xref
+  linkend="pragmas">).</para>
+
+    <variablelist>
+
+       <varlistentry>
+         <term><option>-fext-core</option></term>
+         <indexterm>
+           <primary><option>-fext-core</option></primary>
+         </indexterm>
+         <listitem>
+           <para>Generate <literal>.hcr</literal> files.</para>
+         </listitem>
+       </varlistentry>
+
+    </variablelist>
+
+<para>GHC can also read in External Core files as source; just give the <literal>.hcr</literal> file on
+the command line, instead of the <literal>.hs</literal> or <literal>.lhs</literal> Haskell source.
+A current infelicity is that you need to give teh <literal>-fglasgow-exts</literal> flag too, because
+ordinary Haskell 98, when translated to External Core, uses things like rank-2 types.</para>
+</sect1>
+
 &debug;
 &flags;