diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-02-03 21:17:11 +0100 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-02-04 00:16:40 +0100 |
commit | 77cca55cb7f9ffc9ce7f165aeddb93e81a833a41 (patch) | |
tree | 12f3c808371d9060c8256793d64c6a9f668b62ee /docs/users_guide | |
parent | 58ed6c4a0999c0025b1b024bc26171fa6d6773b3 (diff) | |
download | haskell-wip/display-inferred.tar.gz |
Always display inferred variables using braceswip/display-inferred
We now always show "forall {a}. T" for inferred variables,
previously this was controlled by -fprint-explicit-foralls.
This implements part 1 of https://github.com/ghc-proposals/ghc-proposals/pull/179.
Part of GHC ticket #16320.
Furthermore, when printing a levity restriction error, we now display
the HsWrap of the expression. This lets users see the full elaboration with
-fprint-typechecker-elaboration (see also #17670)
Diffstat (limited to 'docs/users_guide')
-rw-r--r-- | docs/users_guide/exts/poly_kinds.rst | 3 | ||||
-rw-r--r-- | docs/users_guide/exts/type_applications.rst | 6 | ||||
-rw-r--r-- | docs/users_guide/using.rst | 3 |
3 files changed, 4 insertions, 8 deletions
diff --git a/docs/users_guide/exts/poly_kinds.rst b/docs/users_guide/exts/poly_kinds.rst index 96a0a92f34..b41176a6c8 100644 --- a/docs/users_guide/exts/poly_kinds.rst +++ b/docs/users_guide/exts/poly_kinds.rst @@ -152,8 +152,7 @@ Note that ``k2`` is placed *before* ``k``, and that ``k`` is placed *before* type and kind variables that GHC generalises over, but not written in the original program, are not available for visible type application. (These are called *inferred* variables.) -Such variables are written in braces with -:ghc-flag:`-fprint-explicit-foralls` enabled. +Such variables are written in braces. The general principle is this: diff --git a/docs/users_guide/exts/type_applications.rst b/docs/users_guide/exts/type_applications.rst index 2e789c99e3..2a735436d8 100644 --- a/docs/users_guide/exts/type_applications.rst +++ b/docs/users_guide/exts/type_applications.rst @@ -73,9 +73,9 @@ Because ``k`` was not written by the user, it will be unavailable for type application in the type of the constructor ``Proxy``; only the ``a`` will be available. -When :ghc-flag:`-fprint-explicit-foralls` is enabled, inferred variables -are printed in braces. Thus, the type of the data constructor ``Proxy`` -from the previous example would be ``forall {k} (a :: k). Proxy a``. +Inferred variables are printed in braces. Thus, the type of the data +constructor ``Proxy`` from the previous example is +``forall {k} (a :: k). Proxy a``. We can observe this behavior in a GHCi session: :: > :set -XTypeApplications -fprint-explicit-foralls diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 8d4bb64330..86094cc9cc 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -771,9 +771,6 @@ messages and in GHCi: (a Data.Type.Equality.:~: b) -> b Data.Type.Equality.:~: a -- Defined in Data.Type.Equality - This flag also enables the printing of *inferred* type variables - inside braces. See :ref:`inferred-vs-specified`. - .. ghc-flag:: -fprint-explicit-kinds :shortdesc: Print explicit kind foralls and kind arguments in types. See also :extension:`KindSignatures` |