From f7edc8782816d0c6befd9517743bc9e8ebc378c3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Tue, 7 Aug 2001 11:08:36 +0000 Subject: [PATCH] [project @ 2001-08-07 11:08:36 by simonmar] - 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 | 47 ++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 5c1483c..97e02cf 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -2533,15 +2533,28 @@ would get a monomorphic type. - -Pragmas - + + Pragmas - -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. - + pragma + + 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. + + Pragmas all take the form + +{-# word ... #-} + + where word indicates the type of + pragma, and is followed optionally by information specific to that + type of pragma. Case is ignored in + word. The various values for + word that GHC understands are described + in the following sections; any pragma encountered with an + unrecognised word is (silently) + ignored. INLINE pragma @@ -2613,17 +2626,23 @@ For example, in GHC's own <literal>UniqueSupply</literal> monad code, we have: <title>NOINLINE pragma - NOINLINE pragma -pragma, NOINLINE - +pragmaNOINLINE +NOTINLINE pragma +pragmaNOTINLINE -The NOINLINE 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 NOINLINE 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. +NOTINLINE is a synonym for +NOINLINE (NOTINLINE 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). + -- 1.7.10.4