Add -fwarn-monomorphism-restriction (on by default) to warn when the MR is used
[ghc-hetmet.git] / docs / users_guide / using.xml
index 73f5637..88f9e5e 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">
@@ -305,7 +310,7 @@ 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>
 
@@ -338,10 +343,11 @@ module X where
       <varlistentry>
        <term>
           <cmdsynopsis>
-          <command>ghc --version</command> <command>ghc -V</command> 
+            <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>
-           </cmdsynopsis>
         </term>
        <listitem>
          <para>Print a one-line string including GHC's version number.</para>
@@ -351,9 +357,9 @@ module X where
       <varlistentry>
        <term>
           <cmdsynopsis>
-          <command>ghc --numeric-version</command>
+            <command>ghc --numeric-version</command>
+          </cmdsynopsis>
           <indexterm><primary><option>&ndash;&ndash;numeric-version</option></primary></indexterm>
-           </cmdsynopsis>
         </term>
        <listitem>
          <para>Print GHC's numeric version number only.</para>
@@ -363,9 +369,9 @@ module X where
       <varlistentry>
        <term>
          <cmdsynopsis>
-          <command>ghc --print-libdir</command>
+            <command>ghc --print-libdir</command>
+          </cmdsynopsis>
           <indexterm><primary><option>&ndash;&ndash;print-libdir</option></primary></indexterm>
-           </cmdsynopsis>
         </term>
        <listitem>
          <para>Print the path to GHC's library directory.  This is
@@ -625,8 +631,8 @@ ghc -c Foo.hs</screen>
     <indexterm><primary>help options</primary></indexterm>
     <indexterm><primary>verbosity options</primary></indexterm>
 
-    See also the <option>--help</option>, <option>--version</option>, <option>--numeric-version</option>,
-    and <option>--print-libdir</option> modes in <xref linkend="modes"/>.
+    <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>
@@ -1000,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>
@@ -1097,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>
@@ -1117,6 +1136,20 @@ f "2"    = 2
       </varlistentry>
 
       <varlistentry>
+       <term><option>-fwarn-monomorphism-restriction</option>:</term>
+       <listitem>
+         <indexterm><primary><option>-fwarn-monomorphism-restriction</option></primary></indexterm>
+         <indexterm><primary>monomorphism restriction, warning</primary></indexterm>
+         <para>Have the compiler warn/inform you where in your source
+          the Haskell Monomorphism Restriction is applied.  If applied silently
+         the MR can give rise to unexpected behaviour, so it can be helpful
+         to have an explicit warning that it is being applied.</para>
+
+         <para>This warning is on by default.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term><option>-fwarn-unused-binds</option>:</term>
        <listitem>
          <indexterm><primary><option>-fwarn-unused-binds</option></primary></indexterm>
@@ -1252,10 +1285,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>
 
@@ -1354,7 +1383,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>
@@ -1509,7 +1538,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>
 
@@ -1539,7 +1568,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>