[project @ 2005-01-28 14:41:09 by simonmar]
[ghc-hetmet.git] / ghc / docs / users_guide / glasgow_exts.xml
index d058119..765ff85 100644 (file)
@@ -219,6 +219,28 @@ documentation</ulink> describes all the libraries that come with GHC.
       </varlistentry>
 
       <varlistentry>
+       <term><option>-fimplicit-params</option></term>
+       <listitem>
+         <para>Enables implicit parameters (see <xref
+         linkend="implicit-parameters"/>).  Currently also implied by 
+         <option>-fglasgow-exts</option>.</para>
+
+         <para>Syntax stolen:
+         <literal>?<replaceable>varid</replaceable></literal>,
+         <literal>%<replaceable>varid</replaceable></literal>.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
+       <term><option>-fscoped-type-variables</option></term>
+       <listitem>
+         <para>Enables lexically-scoped type variables (see <xref
+         linkend="scoped-type-variables"/>).  Implied by
+         <option>-fglasgow-exts</option>.</para>
+       </listitem>
+      </varlistentry>
+
+      <varlistentry>
        <term><option>-fth</option></term>
        <listitem>
          <para>Enables Template Haskell (see <xref
@@ -233,19 +255,6 @@ documentation</ulink> describes all the libraries that come with GHC.
        </listitem>
       </varlistentry>
 
-      <varlistentry>
-       <term><option>-fimplicit-params</option></term>
-       <listitem>
-         <para>Enables implicit parameters (see <xref
-         linkend="implicit-parameters"/>).  Currently also implied by 
-         <option>-fglasgow-exts</option>.</para>
-
-         <para>Syntax stolen:
-         <literal>?<replaceable>varid</replaceable></literal>,
-         <literal>%<replaceable>varid</replaceable></literal>.</para>
-       </listitem>
-      </varlistentry>
-
     </variablelist>
   </sect1>
 
@@ -4191,6 +4200,31 @@ Assertion failures can be caught, see the documentation for the
       <option>-fno-warn-deprecations</option>.</para>
     </sect2>
 
+    <sect2 id="include-pragma">
+      <title>INCLUDE pragma</title>
+
+      <para>The <literal>INCLUDE</literal> pragma is for specifying the names
+       of C header files that should be <literal>#include</literal>'d into
+       the C source code generated by the compiler for the current module (if
+       compiling via C).  For example:</para>
+
+<programlisting>
+{-# INCLUDE "foo.h" #-}
+{-# INCLUDE &lt;stdio.h&gt; #-}</programlisting>
+
+      <para>The <literal>INCLUDE</literal> pragma(s) must appear at the top of
+       your source file with any <literal>OPTIONS_GHC</literal>
+       pragma(s).</para>
+
+      <para>An <literal>INCLUDE</literal> pragma is  the preferred alternative
+       to the <option>-#include</option> option (<xref
+         linkend="options-C-compiler" />), because the
+       <literal>INCLUDE</literal> pragma is understood by other
+       compilers.  Yet another alternative is to add the include file to each
+       <literal>foreign import</literal> declaration in your code, but we
+       don't recommend using this approach with GHC.</para>
+    </sect2>
+
     <sect2 id="inline-noinline-pragma">
       <title>INLINE and NOINLINE pragmas</title>
 
@@ -4364,16 +4398,19 @@ key_function :: Int -> String -> (Bool, Double)
     </sect2>
 
     <sect2 id="options-pragma">
-      <title>OPTIONS pragma</title>
-      <indexterm><primary>OPTIONS</primary>
+      <title>OPTIONS_GHC pragma</title>
+      <indexterm><primary>OPTIONS_GHC</primary>
       </indexterm>
-      <indexterm><primary>pragma</primary><secondary>OPTIONS</secondary>
+      <indexterm><primary>pragma</primary><secondary>OPTIONS_GHC</secondary>
       </indexterm>
 
-      <para>The <literal>OPTIONS</literal> pragma is used to specify
+      <para>The <literal>OPTIONS_GHC</literal> pragma is used to specify
       additional options that are given to the compiler when compiling
       this source file.  See <xref linkend="source-file-options"/> for
       details.</para>
+
+      <para>Previous versions of GHC accepted <literal>OPTIONS</literal> rather
+       than <literal>OPTIONS_GHC</literal>, but that is now deprecated.</para>
     </sect2>
 
     <sect2 id="rules">