Allow class and instance decls in hs-boot files
[ghc-hetmet.git] / docs / users_guide / glasgow_exts.xml
index 7a918a8..0beed8e 100644 (file)
@@ -128,6 +128,45 @@ documentation</ulink> describes all the libraries that come with GHC.
 
       <varlistentry>
        <term>
+          <option>-fno-mono-pat-binds</option>:
+          <indexterm><primary><option>-fno-mono-pat-binds</option></primary></indexterm>
+          <indexterm><primary><option>-fmono-pat-binds</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para> As an experimental change, we are exploring the possibility of
+         making pattern bindings monomorphic; that is, not generalised at all.  
+           A pattern binding is a binding whose LHS has no function arguments,
+           and is not a simple variable.  For example:
+<programlisting>
+  f x = x                    -- Not a pattern binding
+  f = \x -> x                -- Not a pattern binding
+  f :: Int -> Int = \x -> x  -- Not a pattern binding
+
+  (g,h) = e                  -- A pattern binding
+  (f) = e                    -- A pattern binding
+  [x] = e                    -- A pattern binding
+</programlisting>
+Experimentally, GHC now makes pattern bindings monomorphic <emphasis>by
+default</emphasis>.  Use <option>-fno-mono-pat-binds</option> to recover the
+standard behaviour.
+          </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
+          <option>-fextended-default-rules</option>:
+          <indexterm><primary><option>-fextended-default-rules</option></primary></indexterm>
+        </term>
+       <listitem>
+         <para> Use GHCi's extended default rules in a regular module (<xref linkend="extended-default-rules"/>).
+          Independent of the <option>-fglasgow-exts</option>
+          flag. </para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term>
           <option>-fallow-overlapping-instances</option>
           <indexterm><primary><option>-fallow-overlapping-instances</option></primary></indexterm>
         </term>
@@ -6072,7 +6111,7 @@ shortcoming is something that could be fixed, with some kind of pragma.)
 </para>
 </sect2>
 
-<sect2> <title>The <literal>inline</literal> function </title>
+<sect2> <title>The <literal>lazy</literal> function </title>
 <para>
 The <literal>lazy</literal> function restrains strictness analysis a little:
 <programlisting>
@@ -6097,6 +6136,21 @@ look strict in <literal>y</literal> which would defeat the whole
 purpose of <literal>par</literal>.
 </para>
 </sect2>
+
+<sect2> <title>The <literal>unsafeCoerce#</literal> function </title>
+<para>
+The function <literal>unsafeCoerce#</literal> allows you to side-step the
+typechecker entirely.  It has type
+<programlisting>
+  unsafeCoerce# :: a -> b
+</programlisting>
+That is, it allows you to coerce any type into any other type.  If you use this
+function, you had better get it right, otherwise segmentation faults await. 
+It is generally used when you want to write a program that you know is
+well-typed, but where Haskell's type system is not expressive enough to prove
+that it is well typed.
+</para>
+</sect2>
 </sect1>