diff options
author | Adam Sandberg Ericsson <adam@sandbergericsson.se> | 2020-06-15 18:07:49 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-06-17 15:32:44 -0400 |
commit | 4cab68974dba3e674016514c939946ce60e58273 (patch) | |
tree | c149a29edd44e9ad0aaf51c1949dad63b26222cf /docs/users_guide/exts/gadt_syntax.rst | |
parent | 0639dc10e214280a90dd6b75ce86cf43d1eb2286 (diff) | |
download | haskell-4cab68974dba3e674016514c939946ce60e58273.tar.gz |
docs: fix formatting in users guide
Diffstat (limited to 'docs/users_guide/exts/gadt_syntax.rst')
-rw-r--r-- | docs/users_guide/exts/gadt_syntax.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/users_guide/exts/gadt_syntax.rst b/docs/users_guide/exts/gadt_syntax.rst index 9b20c27ab1..970d2fce90 100644 --- a/docs/users_guide/exts/gadt_syntax.rst +++ b/docs/users_guide/exts/gadt_syntax.rst @@ -161,23 +161,23 @@ Where: - ``btype`` is a type that is not allowed to have an outermost ``forall``/``=>`` unless it is surrounded by parentheses. For example, - ``forall a. a`` and ``Eq a => a`` are not legal ``btype``s, but + ``forall a. a`` and ``Eq a => a`` are not legal ``btype``\ s, but ``(forall a. a)`` and ``(Eq a => a)`` are legal. - ``ctype`` is a ``btype`` that has no restrictions on an outermost - ``forall``/``=>``, so ``forall a. a`` and ``Eq a => a`` are legal ``ctype``s. -- ``return_type`` is a type that is not allowed to have ``forall``s, ``=>``s, - or ``->``s. + ``forall``/``=>``, so ``forall a. a`` and ``Eq a => a`` are legal ``ctype``\ s. +- ``return_type`` is a type that is not allowed to have ``forall``\ s, ``=>``\ s, + or ``->``\ s. This is a simplified grammar that does not fully delve into all of the implementation details of GHC's parser (such as the placement of Haddock comments), but it is sufficient to attain an understanding of what is syntactically allowed. Some further various observations about this grammar: -- GADT constructor types are currently not permitted to have nested ``forall``s - or ``=>``s. (e.g., something like ``MkT :: Int -> forall a. a -> T`` would be +- GADT constructor types are currently not permitted to have nested ``forall``\ s + or ``=>``\ s. (e.g., something like ``MkT :: Int -> forall a. a -> T`` would be rejected.) As a result, ``gadt_sig`` puts all of its quantification and constraints up front with ``opt_forall`` and ``opt_context``. Note that - higher-rank ``forall``s and ``=>``s are only permitted if they do not appear + higher-rank ``forall``\ s and ``=>``\ s are only permitted if they do not appear directly to the right of a function arrow in a `prefix_gadt_body`. (e.g., something like ``MkS :: Int -> (forall a. a) -> S`` is allowed, since parentheses separate the ``forall`` from the ``->``.) |