diff options
author | Ben Gamari <ben@smart-cactus.org> | 2016-03-13 12:56:37 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-03-13 18:12:15 +0100 |
commit | 9ee51da1a9a0d0c4215d8fc9dce32db63c57aa99 (patch) | |
tree | 4e3bec684619dab760d28281dd0a2c4f6f59b771 /docs/users_guide/using.rst | |
parent | 92821ec9a57817e1429ae94c756539259488b728 (diff) | |
download | haskell-9ee51da1a9a0d0c4215d8fc9dce32db63c57aa99.tar.gz |
users_guide: Break up -fprint-* description
This makes it a bit easier to find the description corresponding to
particular flags.
Diffstat (limited to 'docs/users_guide/using.rst')
-rw-r--r-- | docs/users_guide/using.rst | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst index 47fdd296b2..96bd0a11ed 100644 --- a/docs/users_guide/using.rst +++ b/docs/users_guide/using.rst @@ -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 |