[project @ 2001-08-07 11:08:36 by simonmar]
authorsimonmar <unknown>
Tue, 7 Aug 2001 11:08:36 +0000 (11:08 +0000)
committersimonmar <unknown>
Tue, 7 Aug 2001 11:08:36 +0000 (11:08 +0000)
- describe NOTINLINE as a synonym for NOINLINE
- describe the general form of a pragma
- mention that case is irrelevant in the first word of a pragma
- mention that unrecognised pragmas are silently ignored

ghc/docs/users_guide/glasgow_exts.sgml

index 5c1483c..97e02cf 100644 (file)
@@ -2533,15 +2533,28 @@ would get a monomorphic type.
 
 </sect1>
 
-<sect1 id="pragmas">
-<title>Pragmas
-</title>
+  <sect1 id="pragmas">
+    <title>Pragmas</title>
 
-<para>
-GHC supports several pragmas, or instructions to the compiler placed
-in the source code.  Pragmas don't affect the meaning of the program,
-but they might affect the efficiency of the generated code.
-</para>
+    <indexterm><primary>pragma</primary></indexterm>
+
+    <para>GHC supports several pragmas, or instructions to the
+    compiler placed in the source code.  Pragmas don't normally affect
+    the meaning of the program, but they might affect the efficiency
+    of the generated code.</para>
+
+    <para>Pragmas all take the form
+
+<literal>{-# <replaceable>word</replaceable> ... #-}</literal>  
+
+    where <replaceable>word</replaceable> indicates the type of
+    pragma, and is followed optionally by information specific to that
+    type of pragma.  Case is ignored in
+    <replaceable>word</replaceable>.  The various values for
+    <replaceable>word</replaceable> that GHC understands are described
+    in the following sections; any pragma encountered with an
+    unrecognised <replaceable>word</replaceable> is (silently)
+    ignored.</para>
 
 <sect2 id="inline-pragma">
 <title>INLINE pragma
@@ -2613,17 +2626,23 @@ For example, in GHC's own <literal>UniqueSupply</literal> monad code, we have:
 <title>NOINLINE pragma
 </title>
 
-<para>
 <indexterm><primary>NOINLINE pragma</primary></indexterm>
-<indexterm><primary>pragma, NOINLINE</primary></indexterm>
-</para>
+<indexterm><primary>pragma</primary><secondary>NOINLINE</secondary></indexterm>
+<indexterm><primary>NOTINLINE pragma</primary></indexterm>
+<indexterm><primary>pragma</primary><secondary>NOTINLINE</secondary></indexterm>
 
 <para>
-The <literal>NOINLINE</literal> pragma does exactly what you'd expect: it stops the
-named function from being inlined by the compiler.  You shouldn't ever
-need to do this, unless you're very cautious about code size.
+The <literal>NOINLINE</literal> pragma does exactly what you'd expect:
+it stops the named function from being inlined by the compiler.  You
+shouldn't ever need to do this, unless you're very cautious about code
+size.
 </para>
 
+<para><literal>NOTINLINE</literal> is a synonym for
+<literal>NOINLINE</literal> (<literal>NOTINLINE</literal> is specified
+by Haskell 98 as the standard way to disable inlining, so it should be
+used if you want your code to be portable).</para>
+
 </sect2>
 
     <sect2 id="specialize-pragma">