[commit: ghc] wip/T13633, wip/non-det-ci: User's Guide: forall is a keyword nowadays (ae7d1ff)
git at git.haskell.org
git at git.haskell.org
Sun Feb 24 20:55:10 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branches: wip/T13633,wip/non-det-ci
Link : http://ghc.haskell.org/trac/ghc/changeset/ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78/ghc
>---------------------------------------------------------------
commit ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78
Author: Vladislav Zavialov <vlad.z.4096 at gmail.com>
Date: Fri Feb 22 16:51:48 2019 +0300
User's Guide: forall is a keyword nowadays
>---------------------------------------------------------------
ae7d1ff62f61e2ded772d4c58cda3c130bbdcf78
docs/users_guide/bugs.rst | 7 +++++++
docs/users_guide/glasgow_exts.rst | 10 ++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst
index 96cdd25..c563083 100644
--- a/docs/users_guide/bugs.rst
+++ b/docs/users_guide/bugs.rst
@@ -42,6 +42,13 @@ Lexical syntax
as a single qualified operator rather than the two lexemes ``M`` and
``.\``.
+- ``forall`` is always a reserved keyword at the type level, contrary
+ to the Haskell Report, which allows type variables to be named ``forall``.
+ Note that this does not imply that GHC always enables the
+ :ghc-flag:`-XExplicitForAll` extension. Even without this extension enabled,
+ reserving ``forall`` as a keyword has significance. For instance, GHC will
+ not parse the type signature ``foo :: forall x``.
+
.. _infelicities-syntax:
Context-free syntax
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index c8afa44..eae0283 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -2236,9 +2236,10 @@ The following syntax is stolen:
.. index::
single: forall
- Stolen (in types) by: :extension:`ExplicitForAll`, and hence by
- :extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`,
- :extension:`RankNTypes`, :extension:`ExistentialQuantification`
+ Stolen (in types) by default (see :ref:`infelicities-lexical`). ``forall`` is
+ a reserved keyword and never a type variable, in accordance with `GHC Proposal #43
+ <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0043-forall-keyword.rst>`__.
+
``mdo``
.. index::
@@ -10105,9 +10106,6 @@ in :ref:`data-instance-declarations`, :ref:`type-instance-declarations`,
Notes:
-- With :extension:`ExplicitForAll`, ``forall`` becomes a keyword; you can't use ``forall`` as a
- type variable any more!
-
- As well in type signatures, you can also use an explicit ``forall``
in an instance declaration: ::
More information about the ghc-commits
mailing list