Commit ae7d1ff6 authored by Vladislav Zavialov's avatar Vladislav Zavialov Committed by Marge Bot
Browse files

User's Guide: forall is a keyword nowadays

parent 88970187
Pipeline #2694 passed with stages
in 912 minutes and 22 seconds
...@@ -42,6 +42,13 @@ Lexical syntax ...@@ -42,6 +42,13 @@ Lexical syntax
as a single qualified operator rather than the two lexemes ``M`` and 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: .. _infelicities-syntax:
Context-free syntax Context-free syntax
......
...@@ -2236,9 +2236,10 @@ The following syntax is stolen: ...@@ -2236,9 +2236,10 @@ The following syntax is stolen:
.. index:: .. index::
single: forall single: forall
   
Stolen (in types) by: :extension:`ExplicitForAll`, and hence by Stolen (in types) by default (see :ref:`infelicities-lexical`). ``forall`` is
:extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`, a reserved keyword and never a type variable, in accordance with `GHC Proposal #43
:extension:`RankNTypes`, :extension:`ExistentialQuantification` <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0043-forall-keyword.rst>`__.
   
``mdo`` ``mdo``
.. index:: .. index::
...@@ -10105,9 +10106,6 @@ in :ref:`data-instance-declarations`, :ref:`type-instance-declarations`, ...@@ -10105,9 +10106,6 @@ in :ref:`data-instance-declarations`, :ref:`type-instance-declarations`,
   
Notes: 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`` - As well in type signatures, you can also use an explicit ``forall``
in an instance declaration: :: in an instance declaration: ::
   
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment