Commit 9ee51da1 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

users_guide: Break up -fprint-* description

This makes it a bit easier to find the description corresponding to
particular flags.
parent 92821ec9
......@@ -609,20 +609,30 @@ See also the ``--help``, ``--version``, ``--numeric-version``, and
representation after each compilation phase is also printed
(excluding preprocessed and C/assembly files).
.. ghc-flag:: --fprint-potential-instances
.. ghc-flag:: -fprint-potential-instances
When GHC can't find an instance for a class, it displays a short
list of some in the instances it knows about. With this flag it
prints *all* the instances it knows about.
The following flags control the way in which GHC displays types in error
messages and in GHCi:
.. ghc-flag:: -fprint-unicode-syntax
When enabled GHC prints type signatures using the unicode symbols from the
:ghc-flag:`-XUnicodeSyntax` extension. For instance,
.. code-block:: none
ghci> :set -fprint-unicode-syntax
ghci> :t (>>)
(>>) :: (m :: * *) a b. Monad m m a m b m b
.. ghc-flag:: -fprint-explicit-foralls
-fprint-explicit-kinds
-fprint-unicode-syntax
-fprint-explicit-coercions
-fprint-equality-relations
These flags control the way in which GHC displays types, in
error messages and in GHCi. Using :ghc-flag:`-fprint-explicit-foralls` makes
Using :ghc-flag:`-fprint-explicit-foralls` makes
GHC print explicit ``forall`` quantification at the top level of a
type; normally this is suppressed. For example, in GHCi:
......@@ -656,6 +666,8 @@ See also the ``--help``, ``--version``, ``--numeric-version``, and
(a Data.Type.Equality.:~: b) -> b Data.Type.Equality.:~: a
-- Defined in Data.Type.Equality
.. ghc-flag:: -fprint-explicit-kinds
Using :ghc-flag:`-fprint-explicit-kinds` makes GHC print kind arguments in
types, which are normally suppressed. This can be important when you
are using kind polymorphism. For example:
......@@ -670,21 +682,15 @@ See also the ``--help``, ``--version``, ``--numeric-version``, and
ghci> :t MkT
MkT :: forall (k :: BOX) (a :: k). T k a
When :ghc-flag:`-fprint-unicode-syntax` is enabled, GHC prints type
signatures using the unicode symbols from the :ghc-flag:`-XUnicodeSyntax`
extension.
.. code-block:: none
ghci> :set -fprint-unicode-syntax
ghci> :t (>>)
(>>) :: (m :: * *) a b. Monad m m a m b m b
.. ghc-flag:: -fprint-explicit-coercions
Using :ghc-flag:`-fprint-explicit-coercions` makes GHC print coercions in
types. When trying to prove the equality between types of different
kinds, GHC uses type-level coercions. Users will rarely need to
see these, as they are meant to be internal.
.. ghc-flag:: -fprint-equality-relations
Using :ghc-flag:`-fprint-equality-relations` tells GHC to distinguish between
its equality relations when printing. For example, ``~`` is homogeneous
lifted equality (the kinds of its arguments are the same) while
......
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