[commit: ghc] ghc-8.0: Document implicit quantification better (590b84b)
git at git.haskell.org
git at git.haskell.org
Fri Mar 25 11:14:46 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/590b84bd6fff4ee43891c7a2e9ec81942edc8052/ghc
>---------------------------------------------------------------
commit 590b84bd6fff4ee43891c7a2e9ec81942edc8052
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Mar 25 10:32:13 2016 +0000
Document implicit quantification better
Addresses Trac #11726
(cherry picked from commit da4bc0cff142225ed7fda7101cb6e559f025ebc1)
>---------------------------------------------------------------
590b84bd6fff4ee43891c7a2e9ec81942edc8052
docs/users_guide/glasgow_exts.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 603ab95..38106b0 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -9145,7 +9145,9 @@ the following pairs are equivalent: ::
h x y = y
in ...
-Notice that GHC does *not* find the inner-most possible quantification
+Notice that GHC always adds implicit quantfiers *at the outermost level*
+of a user-written type; it
+does *not* find the inner-most possible quantification
point. For example: ::
f :: (a -> a) -> Int
@@ -9156,13 +9158,12 @@ point. For example: ::
g :: (Ord a => a -> a) -> Int
- -- MEANS the illegal type
+ -- MEANS
g :: forall a. (Ord a => a -> a) -> Int
-- NOT
g :: (forall a. Ord a => a -> a) -> Int
-The latter produces an illegal type, which you might think is silly, but
-at least the rule is simple. If you want the latter type, you can write
+If you want the latter type, you can write
your ``forall``\s explicitly. Indeed, doing so is strongly advised for
rank-2 types.
More information about the ghc-commits
mailing list