X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=docs%2Fusers_guide%2Fglasgow_exts.xml;h=9ea3332463d109f0aa2f22a185701c66147837d0;hb=6cec61d14a324285dbb8ce73d4c7215f1f8d6766;hp=a29e7478c81cd9554eb0358c9831e27cee769146;hpb=d91240674cd45cb4677adca5829a1851ba3cd044;p=ghc-hetmet.git
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index a29e747..9ea3332 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -450,43 +450,6 @@ Indeed, the bindings can even be recursive.
-
- New qualified operator syntax
-
- A new syntax for referencing qualified operators is
- planned to be introduced by Haskell', and is enabled in GHC
- with
- the
- option. In the new syntax, the prefix form of a qualified
- operator is
- written module.(symbol)
- (without NewQualifiedOperators this would
- be (module.symbol)),
- and the infix form is
- written `module.(symbol)`
- (without NewQualifiedOperators this would
- be `module.symbol`.
- For example:
-
- add x y = Prelude.(+) x y
- subtract y = (`Prelude.(-)` y)
-
- The new form of qualified operators is intended to regularise
- the syntax by eliminating odd cases
- like Prelude... For example,
- when NewQualifiedOperators is on, it is possible to
- write the enumerated sequence [Monday..]
- without spaces, whereas without NewQualifiedOperators this would be a
- reference to the operator ‘.‘
- from module Monday.
-
- When is on, the old
- syntax for qualified operators is not accepted, so this
- option may cause existing code to break.
-
-
-
-
@@ -2471,7 +2434,8 @@ declarations. Define your own instances!
Declaring data types with explicit constructor signatures
-GHC allows you to declare an algebraic data type by
+When the GADTSyntax extension is enabled,
+GHC allows you to declare an algebraic data type by
giving the type signatures of constructors explicitly. For example:
data Maybe a where
@@ -4041,18 +4005,21 @@ The willingness to be overlapped or incoherent is a property of
the instance declaration itself, controlled by the
presence or otherwise of the
and flags when that module is
-being defined. Neither flag is required in a module that imports and uses the
-instance declaration. Specifically, during the lookup process:
+being defined. Specifically, during the lookup process:
-An instance declaration is ignored during the lookup process if (a) a more specific
-match is found, and (b) the instance declaration was compiled with
-. The flag setting for the
-more-specific instance does not matter.
+If the constraint being looked up matches two instance declarations IA and IB,
+and
+
+IB is a substitution instance of IA (but not vice versa);
+that is, IB is strictly more specific than IA
+either IA or IB was compiled with
+
+then the less-specific instance IA is ignored.
Suppose an instance declaration does not match the constraint being looked up, but
-does unify with it, so that it might match when the constraint is further
+does unify with it, so that it might match when the constraint is further
instantiated. Usually GHC will regard this as a reason for not committing to
some other constraint. But if the instance declaration was compiled with
, GHC will skip the "does-it-unify?"
@@ -4062,18 +4029,6 @@ check for that declaration.
These rules make it possible for a library author to design a library that relies on
overlapping instances without the library client having to know.
-
-If an instance declaration is compiled without
-,
-then that instance can never be overlapped. This could perhaps be
-inconvenient. Perhaps the rule should instead say that the
-overlapping instance declaration should be compiled in
-this way, rather than the overlapped one. Perhaps overlap
-at a usage site should be permitted regardless of how the instance declarations
-are compiled, if the flag is
-used at the usage site. (Mind you, the exact usage site can occasionally be
-hard to pin down.) We are interested to receive feedback on these points.
-The flag implies the
flag, but not vice versa.
@@ -5771,9 +5726,6 @@ for rank-2 types.
Impredicative polymorphism
-NOTE: the impredicative-polymorphism feature is deprecated in GHC 6.12, and
-will be removed or replaced in GHC 6.14.
-
GHC supports impredicative polymorphism,
enabled with .
This means
@@ -5896,7 +5848,7 @@ signature is explicit. For example:
g (x:xs) = xs ++ [ x :: a ]
This program will be rejected, because "a" does not scope
-over the definition of "f", so "x::a"
+over the definition of "g", so "x::a"
means "x::forall a. a" by Haskell's usual implicit
quantification rules.
@@ -5932,7 +5884,7 @@ type variables, in the annotated expression. For example:
f = runST ( (op >>= \(x :: STRef s Int) -> g x) :: forall s. ST s Bool )
-Here, the type signature forall a. ST s Bool brings the
+Here, the type signature forall s. ST s Bool brings the
type variable s into scope, in the annotated expression
(op >>= \(x :: STRef s Int) -> g x).
@@ -8965,7 +8917,7 @@ An example will give the idea:
- import Generics
+ import Data.Generics
class Bin a where
toBin :: a -> [Int]
@@ -8985,7 +8937,7 @@ An example will give the idea:
This class declaration explains how toBin and fromBin
work for arbitrary data types. They do so by giving cases for unit, product, and sum,
-which are defined thus in the library module Generics:
+which are defined thus in the library module Data.Generics:
data Unit = Unit
@@ -9007,14 +8959,16 @@ where clause and over-ride whichever methods you please.
To use generics you need to
- Use the flags (to enable the extra syntax),
- (to generate extra per-data-type code),
- and (to make the Generics library
- available.
+
+ Use the flags (to enable the
+ extra syntax and generate extra per-data-type code),
+ and (to make the
+ Data.Generics module available.
+
- Import the module Generics from the
- lang package. This import brings into
+ Import the module Data.Generics from the
+ syb package. This import brings into
scope the data types Unit,
:*:, and :+:. (You
don't need this import if you don't mention these types