[Be more specific about file-header pragmas
simonpj@microsoft.com**20070924162847
Document the rules for pragmas that must occur at the top of a file.
Please merge this patch
] {
hunk ./docs/users_guide/flags.xml 792
- Enable kind signatures.
+ Enable kind signatures.
hunk ./docs/users_guide/glasgow_exts.xml 3607
-a type variable is explicitly bound. Namely:
+a type variable is explicitly bound, with the flag .
+
+
+This flag enables kind signatures in the following places:
hunk ./docs/users_guide/glasgow_exts.xml 5312
+ Certain pragmas are file-header pragmas. A file-header
+ pragma must precede the module keyword in the file.
+ There can be as many file-header pragmas as you please, and they can be
+ preceded or followed by comments.
+
+
+ LANGUAGE pragma
+
+ LANGUAGEpragma
+ pragmaLANGUAGE
+
+ The LANGUAGE pragma allows language extensions to be enabled
+ in a portable way.
+ It is the intention that all Haskell compilers support the
+ LANGUAGE pragma with the same syntax, although not
+ all extensions are supported by all compilers, of
+ course. The LANGUAGE pragma should be used instead
+ of OPTIONS_GHC, if possible.
+
+ For example, to enable the FFI and preprocessing with CPP:
+
+{-# LANGUAGE ForeignFunctionInterface, CPP #-}
+
+ LANGUAGE is a file-header pragma (see ).
+
+ Every language extension can also be turned into a command-line flag
+ by prefixing it with "-X"; for example .
+ (Similarly, all "-X" flags can be written as LANGUAGE pragmas.
+
+
+ A list of all supported language extensions can be obtained by invoking
+ ghc --supported-languages (see ).
+
+ Any extension from the Extension type defined in
+ Language.Haskell.Extension
+ may be used. GHC will report an error if any of the requested extensions are not supported.
+
+
+
+
+ OPTIONS_GHC pragma
+ OPTIONS_GHC
+
+ pragmaOPTIONS_GHC
+
+
+ The OPTIONS_GHC pragma is used to specify
+ additional options that are given to the compiler when compiling
+ this source file. See for
+ details.
+
+ Previous versions of GHC accepted OPTIONS rather
+ than OPTIONS_GHC, but that is now deprecated.
+
+
+ OPTIONS_GHC is a file-header pragma (see ).
+
+
+ INCLUDE pragma
+
+ The INCLUDE pragma is for specifying the names
+ of C header files that should be #include'd into
+ the C source code generated by the compiler for the current module (if
+ compiling via C). For example:
+
+
+{-# INCLUDE "foo.h" #-}
+{-# INCLUDE <stdio.h> #-}
+
+ INCLUDE is a file-header pragma (see ).
+
+ An INCLUDE pragma is the preferred alternative
+ to the option (), because the
+ INCLUDE pragma is understood by other
+ compilers. Yet another alternative is to add the include file to each
+ foreign import declaration in your code, but we
+ don't recommend using this approach with GHC.
+
+
hunk ./docs/users_guide/glasgow_exts.xml 5445
-
- INCLUDE pragma
-
- The INCLUDE pragma is for specifying the names
- of C header files that should be #include'd into
- the C source code generated by the compiler for the current module (if
- compiling via C). For example:
-
-
-{-# INCLUDE "foo.h" #-}
-{-# INCLUDE <stdio.h> #-}
-
- The INCLUDE pragma(s) must appear at the top of
- your source file with any OPTIONS_GHC
- pragma(s).
-
- An INCLUDE pragma is the preferred alternative
- to the option (), because the
- INCLUDE pragma is understood by other
- compilers. Yet another alternative is to add the include file to each
- foreign import declaration in your code, but we
- don't recommend using this approach with GHC.
-
-
hunk ./docs/users_guide/glasgow_exts.xml 5591
-
- LANGUAGE pragma
-
- LANGUAGEpragma
- pragmaLANGUAGE
-
- This allows language extensions to be enabled in a portable way.
- It is the intention that all Haskell compilers support the
- LANGUAGE pragma with the same syntax, although not
- all extensions are supported by all compilers, of
- course. The LANGUAGE pragma should be used instead
- of OPTIONS_GHC, if possible.
-
- For example, to enable the FFI and preprocessing with CPP:
-
-{-# LANGUAGE ForeignFunctionInterface, CPP #-}
-
- Any extension from the Extension type defined in
- Language.Haskell.Extension may be used. GHC will report an error if any of the requested extensions are not supported.
-
-
-
hunk ./docs/users_guide/glasgow_exts.xml 5609
-
-
- OPTIONS_GHC pragma
- OPTIONS_GHC
-
- pragmaOPTIONS_GHC
-
-
- The OPTIONS_GHC pragma is used to specify
- additional options that are given to the compiler when compiling
- this source file. See for
- details.
-
- Previous versions of GHC accepted OPTIONS rather
- than OPTIONS_GHC, but that is now deprecated.
-
}