Give the inferred type when warning of a missing type-signature (Trac #1256)
[ghc-hetmet.git] / docs / users_guide / using.xml
index 14665af..82d7afe 100644 (file)
@@ -138,6 +138,11 @@ module X where
     
     <para>The flag reference tables (<xref
     linkend="flag-reference"/>) lists the status of each flag.</para>
+
+    <para>There are a few flags that are static except that they can
+    also be used with GHCi's <literal>:set</literal> command; these
+    are listed as &ldquo;static/<literal>:set</literal>&rdquo; in the
+    table.</para> 
   </sect1>
 
   <sect1 id="file-suffixes">
@@ -225,8 +230,7 @@ module X where
     <variablelist>
       <varlistentry>
        <term>
-         <cmdsynopsis><command>ghc</command>
-           <arg choice='plain'>&ndash;&ndash;interactive</arg>
+         <cmdsynopsis><command>ghc --interactive</command>
          </cmdsynopsis>
           <indexterm><primary>interactive mode</primary></indexterm>
           <indexterm><primary>ghci</primary></indexterm>
@@ -240,8 +244,7 @@ module X where
       
       <varlistentry>
        <term>
-         <cmdsynopsis><command>ghc</command>
-           <arg choice='plain'>&ndash;&ndash;make</arg>
+         <cmdsynopsis><command>ghc --make</command>
          </cmdsynopsis>
           <indexterm><primary>make mode</primary></indexterm>
           <indexterm><primary><option>&ndash;&ndash;make</option></primary></indexterm>
@@ -258,8 +261,8 @@ module X where
 
       <varlistentry>
        <term>
-         <cmdsynopsis><command>ghc</command>
-           <arg choice='plain'>&ndash;e</arg> <arg choice='plain'><replaceable>expr</replaceable></arg>
+         <cmdsynopsis><command>ghc -e</command>
+            <arg choice='plain'><replaceable>expr</replaceable></arg>
           </cmdsynopsis>
           <indexterm><primary>eval mode</primary></indexterm>
        </term>
@@ -275,13 +278,10 @@ module X where
       <varlistentry>
        <term>
           <cmdsynopsis>
-           <command>ghc</command>
-           <group>
-             <arg>-E</arg>
-             <arg>-C</arg>
-             <arg>-S</arg>
-             <arg>-c</arg>
-           </group>
+           <command>ghc -E</command>
+           <command>ghc -c</command>
+           <command>ghc -S</command>
+           <command>ghc -c</command>
          </cmdsynopsis>
          <indexterm><primary><option>-E</option></primary></indexterm>
          <indexterm><primary><option>-C</option></primary></indexterm>
@@ -302,8 +302,7 @@ module X where
       <varlistentry>
        <term>
           <cmdsynopsis>
-            <command>ghc</command>
-           <arg choice='plain'>&ndash;M</arg>
+            <command>ghc -M</command>
           </cmdsynopsis>
           <indexterm><primary>dependency-generation mode</primary></indexterm>
         </term>
@@ -311,23 +310,81 @@ module X where
          <para>Dependency-generation mode.  In this mode, GHC can be
          used to generate dependency information suitable for use in
          a <literal>Makefile</literal>.  See <xref
-         linkend="sec-makefile-dependencies"/>.</para>
+         linkend="makefile-dependencies"/>.</para>
        </listitem>
       </varlistentry>
 
       <varlistentry>
        <term>
           <cmdsynopsis>
-            <command>ghc</command>
-           <arg choice='plain'>&ndash;&ndash;mk-dll</arg>
+            <command>ghc --mk-dll</command>
           </cmdsynopsis>
-         <indexterm><primary>dependency-generation mode</primary></indexterm>
+         <indexterm><primary>DLL-creation mode</primary></indexterm>
         </term>
        <listitem>
          <para>DLL-creation mode (Windows only).  See <xref
          linkend="win32-dlls-create"/>.</para>
        </listitem>
       </varlistentry>
+
+      <varlistentry>
+       <term>
+         <cmdsynopsis>
+          <command>ghc --help</command> <command>ghc -?</command>
+           </cmdsynopsis>
+          <indexterm><primary><option>&ndash;&ndash;help</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Cause GHC to spew a long usage message to standard
+          output and then exit.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <cmdsynopsis>
+            <command>ghc --version</command>
+            <command>ghc -V</command>
+          </cmdsynopsis>
+          <indexterm><primary><option>-V</option></primary></indexterm>
+          <indexterm><primary><option>&ndash;&ndash;version</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Print a one-line string including GHC's version number.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <cmdsynopsis>
+            <command>ghc --numeric-version</command>
+          </cmdsynopsis>
+          <indexterm><primary><option>&ndash;&ndash;numeric-version</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para>Print GHC's numeric version number only.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+         <cmdsynopsis>
+            <command>ghc --print-libdir</command>
+          </cmdsynopsis>
+          <indexterm><primary><option>&ndash;&ndash;print-libdir</option></primary></indexterm>
+        </term>
+       <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>
 
     <sect2 id="make-mode">
@@ -574,19 +631,18 @@ ghc -c Foo.hs</screen>
     <indexterm><primary>help options</primary></indexterm>
     <indexterm><primary>verbosity options</primary></indexterm>
 
+    <para>See also the <option>--help</option>, <option>--version</option>, <option>--numeric-version</option>,
+    and <option>--print-libdir</option> modes in <xref linkend="modes"/>.</para>
     <variablelist>
       <varlistentry>
        <term>
-          <option>&ndash;&ndash;help</option>
-          <indexterm><primary><option>&ndash;&ndash;help</option></primary></indexterm>
-        </term>
-       <term>
-          <option>-?</option>
-          <indexterm><primary><option>-?</option></primary></indexterm>
+          <option>-n</option>
+          <indexterm><primary><option>-n</option></primary></indexterm>
         </term>
        <listitem>
-         <para>Cause GHC to spew a long usage message to standard
-          output and then exit.</para>
+         <para>Does a dry-run, i.e. GHC goes through all the motions
+          of compiling as normal, but does not actually run any
+          external commands.</para>
        </listitem>
       </varlistentry>
 
@@ -673,47 +729,6 @@ ghc -c Foo.hs</screen>
       </varlistentry>
       
       <varlistentry>
-       <term>
-          <option>-V</option>
-          <indexterm><primary><option>-V</option></primary></indexterm>
-        </term>
-       <term>
-          <option>&ndash;&ndash;version</option>
-          <indexterm><primary><option>&ndash;&ndash;version</option></primary></indexterm>
-        </term>
-       <listitem>
-         <para>Print a one-line string including GHC's version number.</para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term>
-          <option>&ndash;&ndash;numeric-version</option>
-          <indexterm><primary><option>&ndash;&ndash;numeric-version</option></primary></indexterm>
-        </term>
-       <listitem>
-         <para>Print GHC's numeric version number only.</para>
-       </listitem>
-      </varlistentry>
-
-      <varlistentry>
-       <term>
-          <option>&ndash;&ndash;print-libdir</option>
-          <indexterm><primary><option>&ndash;&ndash;print-libdir</option></primary></indexterm>
-        </term>
-       <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>
-
-      <varlistentry>
        <term><option>-ferror-spans</option>
           <indexterm><primary><option>-ferror-spans</option></primary>
          </indexterm>
@@ -748,6 +763,20 @@ ghc -c Foo.hs</screen>
       </varlistentry>
 
       <varlistentry>
+        <term><option>-H</option><replaceable>size</replaceable>
+        <indexterm><primary><option>-H</option></primary></indexterm>
+        </term>
+        <listitem>
+          <para>Set the minimum size of the heap to
+          <replaceable>size</replaceable>.
+          This option is equivalent to
+          <literal>+RTS&nbsp;-H<replaceable>size</replaceable></literal>,
+          see <xref linkend="rts-options-gc" />.
+          </para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
         <term><option>-Rghc-timing</option>
         <indexterm><primary><option>-Rghc-timing</option></primary></indexterm>
         </term>
@@ -977,7 +1006,8 @@ f foo = foo { x = 6 }
 
          <para>If you would like GHC to check that every top-level
           function/value has a type signature, use the
-          <option>-fwarn-missing-signatures</option> option.  This
+          <option>-fwarn-missing-signatures</option> option.  As part of
+           the warning GHC also reports the inferred type.  The
           option is off by default.</para>
        </listitem>
       </varlistentry>
@@ -1074,6 +1104,18 @@ f "2"    = 2
       </varlistentry>
 
       <varlistentry>
+       <term><option>-fwarn-tabs</option>:</term>
+       <listitem>
+         <indexterm><primary><option>-fwarn-tabs</option></primary></indexterm>
+         <indexterm><primary>tabs, warning</primary></indexterm>
+         <para>Have the compiler warn if there are tabs in your source
+          file.</para>
+
+         <para>This warning is off by default.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term><option>-fwarn-type-defaults</option>:</term>
        <listitem>
          <indexterm><primary><option>-fwarn-type-defaults</option></primary></indexterm>
@@ -1229,10 +1271,6 @@ f "2"    = 2
            <para>Means: &ldquo;Generate good-quality code without
             taking too long about it.&rdquo; Thus, for example:
             <command>ghc -c -O Main.lhs</command></para>
-
-           <para><option>-O</option> currently also implies
-           <option>-fvia-C</option>.  This may change in the
-           future.</para>
          </listitem>
        </varlistentry>
 
@@ -1331,7 +1369,7 @@ f "2"    = 2
            <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
+           linkend="assertions"/>).  This flag is turned on by
            <option>-O</option>.
            </para>
          </listitem>
@@ -1486,7 +1524,7 @@ f "2"    = 2
   
   &phases;  
   
-  <sect1 id="sec-using-concurrent">
+  <sect1 id="using-concurrent">
     <title>Using Concurrent Haskell</title>
     <indexterm><primary>Concurrent Haskell</primary><secondary>using</secondary></indexterm>
 
@@ -1516,7 +1554,7 @@ f "2"    = 2
     </variablelist>
   </sect1>
 
-  <sect1 id="sec-using-smp">
+  <sect1 id="using-smp">
     <title>Using SMP parallelism</title>
     <indexterm><primary>parallelism</primary>
     </indexterm>