X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fglasgow_exts.sgml;h=8312aee3b7af0db748f77575b8e993331ad9ad55;hb=63020bb3aca65e5842e0eb786a81a355b95ef05a;hp=baf9ef747aaa74f194acdf1475d1aeb6ca3d70eb;hpb=49ac6c398f2915de9eadff3cd2631bc31f806ec8;p=ghc-hetmet.git
diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml
index baf9ef7..8312aee 100644
--- a/ghc/docs/users_guide/glasgow_exts.sgml
+++ b/ghc/docs/users_guide/glasgow_exts.sgml
@@ -2,17 +2,19 @@
language, GHCextensions, GHC
As with all known Haskell systems, GHC implements some extensions to
-the language. To use them, you'll need to give a
--fglasgow-exts option option.
+the language. They are all enabled by options; by default GHC
+understands only plain Haskell 98.
-Virtually all of the Glasgow extensions serve to give you access to
-the underlying facilities with which we implement Haskell. Thus, you
-can get at the Raw Iron, if you are willing to write some non-standard
-code at a more primitive level. You need not be “stuck” on
-performance because of the implementation costs of Haskell's
-“high-level” features—you can always code “under” them. In an extreme case, you can write all your time-critical code in C, and then just glue it together with Haskell!
+Some of the Glasgow extensions serve to give you access to the
+underlying facilities with which we implement Haskell. Thus, you can
+get at the Raw Iron, if you are willing to write some non-portable
+code at a more primitive level. You need not be “stuck”
+on performance because of the implementation costs of Haskell's
+“high-level” features—you can always code
+“under” them. In an extreme case, you can write all your
+time-critical code in C, and then just glue it together with Haskell!
@@ -20,8 +22,8 @@ Before you get too carried away working at the lowest level (e.g.,
sloshing MutableByteArray#s around your
program), you may wish to check if there are libraries that provide a
“Haskellised veneer” over the features you want. The
-separate libraries documentation describes all the libraries that come
-with GHC.
+separate libraries
+documentation describes all the libraries that come with GHC.
@@ -35,10 +37,38 @@ with GHC.
extensionsoptions controlling
- These flags control what variation of the language are
+ These flags control what variation of the language are
permitted. Leaving out all of them gives you standard Haskell
98.
+ NB. turning on an option that enables special syntax
+ might cause working Haskell 98 code to fail
+ to compile, perhaps because it uses a variable name which has
+ become a reserved word. So, together with each option below, we
+ list the special syntax which is enabled by this option. We use
+ notation and nonterminal names from the Haskell 98 lexical syntax
+ (see the Haskell 98 Report). There are two classes of special
+ syntax:
+
+
+
+ New reserved words and symbols: character sequences
+ which are no longer available for use as identifiers in the
+ program.
+
+
+ Other special syntax: sequences of characters that have
+ a different meaning when this particular option is turned
+ on.
+
+
+
+ We are only listing syntax changes here that might affect
+ existing working programs (i.e. "stolen" syntax). Many of these
+ extensions will also enable new context-free syntax, but in all
+ cases programs written to use the new syntax would not be
+ compilable without the option enabled.
+
@@ -49,6 +79,19 @@ with GHC.
Haskell 98 described in , except where otherwise
noted.
+
+ New reserved words: forall (only in
+ types), mdo.
+
+ Other syntax stolen:
+ varid{#},
+ char#,
+ string#,
+ integer#,
+ float#,
+ float##,
+ (#, #),
+ |), {|.
@@ -61,6 +104,8 @@ with GHC.
Haskell 98 Foreign Function Interface Addendum plus deprecated
syntax of previous versions of the FFI for backwards
compatibility.
+
+ New reserved words: foreign.
@@ -103,6 +148,14 @@ with GHC.
See . Independent of
.
+
+ New reserved words/symbols: rec,
+ proc, -<,
+ >-, -<<,
+ >>-.
+
+ Other syntax stolen: (|,
+ |).
@@ -149,6 +202,12 @@ with GHC.
Enables Template Haskell (see ). Currently also implied by
.
+
+ Syntax stolen: [|,
+ [e|, [p|,
+ [d|, [t|,
+ $(,
+ $varid.
@@ -158,6 +217,10 @@ with GHC.
Enables implicit parameters (see ). Currently also implied by
.
+
+ Syntax stolen:
+ ?varid,
+ %varid.