[project @ 2004-10-18 18:24:59 by igloo]
[ghc-hetmet.git] / ghc / docs / users_guide / using.xml
index 2ddc60b..cc4f366 100644 (file)
@@ -333,7 +333,7 @@ ghc ––make Main.hs
        <listitem>
          <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
+         Compiling a multi-module program with <literal>ghc
          &ndash;&ndash;make</literal> can be up to twice as fast as
          running <literal>ghc</literal> individually on each source
          file.</para>
@@ -358,7 +358,7 @@ ghc &ndash;&ndash;make Main.hs
       pragma (see <xref linkend="source-file-options"/>).</para>
 
       <para>If the program needs to be linked with additional objects
-      (say, some auxilliary C code), then the object files can be
+      (say, some auxiliary C code), then the object files can be
       given on the command line and GHC will include them when linking
       the executable.</para>
       
@@ -660,6 +660,39 @@ ghc -c Foo.hs</screen>
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term><option>-ferror-spans</option>
+          <indexterm><primary><option>-ferror-spans</option></primary>
+         </indexterm>
+        </term>
+       <listitem>
+         <para>Causes GHC to emit the full source span of the
+         syntactic entity relating to an error message.  Normally, GHC
+         emits the source location of the start of the syntactic
+         entity only.</para>
+
+         <para>For example:</para>
+
+<screen>test.hs:3:6: parse error on input `where'</screen>
+
+         <para>becomes:</para>
+
+<screen>test296.hs:3:6-10: parse error on input `where'</screen>
+
+         <para>And multi-line spans are possible too:</para>
+
+<screen>test.hs:(5,4)-(6,7):
+    Conflicting definitions for `a'
+    Bound at: test.hs:5:4
+              test.hs:6:7
+    In the binding group for: a, b, a</screen>
+
+         <para>Note that line numbers start counting at one, but
+         column numbers start at zero.  This choice was made to
+         follow existing convention (i.e. this is how Emacs does
+         it).</para>
+       </listitem>
+      </varlistentry>
     </variablelist>
   </sect1>
 
@@ -802,6 +835,33 @@ g [] = 2
       </varlistentry>
 
       <varlistentry>
+       <term><option>-fwarn-incomplete-record-updates</option>:</term>
+       <listitem>
+         <indexterm><primary><option>-fwarn-incomplete-record-updates</option></primary></indexterm>
+         <indexterm><primary>incomplete record updates, warning</primary></indexterm>
+         <indexterm><primary>record updates, incomplete</primary></indexterm>
+
+         <para>The function
+          <function>f</function> below will fail when applied to
+          <literal>Bar</literal>, so the compiler will emit a warning about
+          this when <option>-fwarn-incomplete-record-updates</option> is
+          enabled.</para>
+
+<programlisting>
+data Foo = Foo { x :: Int }
+         | Bar
+
+f :: Foo -> Foo
+f foo = foo { x = 6 }
+</programlisting>
+
+         <para>This option isn't enabled be default because it can be
+          very noisy, and it often doesn't indicate a bug in the
+          program.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term>
           <option>-fwarn-misc</option>:
           <indexterm><primary><option>-fwarn-misc</option></primary></indexterm>
@@ -1710,7 +1770,7 @@ and maintaining internal tables of global addresses.
           only)</primary></indexterm> Means to pass the like-named
           option to GCC; it says to use the Version 8 SPARC
           instructions, notably integer multiply and divide.  The
-          similiar <option>-m*</option> GCC options for SPARC also
+          similar <option>-m*</option> GCC options for SPARC also
           work, actually.</para>
        </listitem>
       </varlistentry>
@@ -1779,7 +1839,7 @@ statements or clauses.
 
 <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
+A current infelicity is that you need to give the <literal>-fglasgow-exts</literal> flag too, because
 ordinary Haskell 98, when translated to External Core, uses things like rank-2 types.</para>
 </sect1>