fix bug in sample code
[ghc-hetmet.git] / docs / users_guide / glasgow_exts.xml
index 319104e..9c1b2c7 100644 (file)
@@ -617,7 +617,7 @@ clunky env var1 var1 = case lookup env var1 of
     Nothing -> fail
     Just val2 -> val1 + val2
 where
-  fail = val1 + val2
+  fail = var1 + var2
 </programlisting>
 
 <para>
@@ -2107,7 +2107,9 @@ can be modified by two flags: <option>-fallow-overlapping-instances</option>
 </primary></indexterm> 
 and <option>-fallow-incoherent-instances</option>
 <indexterm><primary>-fallow-incoherent-instances
-</primary></indexterm>, as this section discusses.</para>
+</primary></indexterm>, as this section discusses.  Both these
+flags are dynamic flags, and can be set on a per-module basis, using 
+an <literal>OPTIONS_GHC</literal> pragma if desired (<xref linkend="source-file-options"/>).</para>
 <para>
 When GHC tries to resolve, say, the constraint <literal>C Int Bool</literal>,
 it tries to match every instance declaration against the
@@ -5378,7 +5380,9 @@ The programmer can specify rewrite rules as part of the source program
 (in a pragma).  GHC applies these rewrite rules wherever it can, provided (a) 
 the <option>-O</option> flag (<xref linkend="options-optimise"/>) is on, 
 and (b) the <option>-frules-off</option> flag
-(<xref linkend="options-f"/>) is not specified.
+(<xref linkend="options-f"/>) is not specified, and (c) the
+<option>-fglasgow-exts</option> (<xref linkend="options-language"/>)
+flag is active.
 </para>
 
 <para>