summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-10-06 15:03:48 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-08 05:12:58 -0400
commit8a2e840893bf5a1f775385713fbf0756f96c470d (patch)
tree6475b5e3eefa71099e8df048981f164ba54be120 /docs/users_guide
parent397c6ed5ca5329408db33a64e45102fff23c969a (diff)
downloadhaskell-8a2e840893bf5a1f775385713fbf0756f96c470d.tar.gz
users-guide: Refer to language extension flags via :extension:
Previously several were referred to via :ghc-flag:`-X...`.
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/8.10.1-notes.rst2
-rw-r--r--docs/users_guide/bugs.rst8
-rw-r--r--docs/users_guide/glasgow_exts.rst22
-rw-r--r--docs/users_guide/intro.rst2
-rw-r--r--docs/users_guide/using-warnings.rst16
-rw-r--r--docs/users_guide/using.rst8
6 files changed, 29 insertions, 29 deletions
diff --git a/docs/users_guide/8.10.1-notes.rst b/docs/users_guide/8.10.1-notes.rst
index 374cf03b09..e5909c95fa 100644
--- a/docs/users_guide/8.10.1-notes.rst
+++ b/docs/users_guide/8.10.1-notes.rst
@@ -168,7 +168,7 @@ Template Haskell
- The ``Lift`` typeclass is now levity-polymorphic and has a ``liftTyped``
method. Previously disallowed instances for unboxed tuples, unboxed sums, an
primitive unboxed types have also been added. Finally, the code generated by
- :ghc-flag:`-XDeriveLift` has been simplified to take advantage of expression
+ :extension:`DeriveLift` has been simplified to take advantage of expression
quotations.
``ghc-prim`` library
diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst
index 009f699512..1106f161b9 100644
--- a/docs/users_guide/bugs.rst
+++ b/docs/users_guide/bugs.rst
@@ -26,8 +26,8 @@ Divergence from Haskell 98 and Haskell 2010
By default, GHC mainly aims to behave (mostly) like a Haskell 2010
compiler, although you can tell it to try to behave like a particular
-version of the language with the :ghc-flag:`-XHaskell98` and
-:ghc-flag:`-XHaskell2010` flags. The known deviations from the standards are
+version of the language with the :extension:`Haskell98` and
+:extension:`Haskell2010` flags. The known deviations from the standards are
described below. Unless otherwise stated, the deviation applies in Haskell 98,
Haskell 2010 and the default modes.
@@ -45,7 +45,7 @@ Lexical syntax
- ``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,
+ :extension:`ExplicitForAll` 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``.
@@ -277,7 +277,7 @@ Numbers, basic types, and built-in classes
``Read`` class methods
The ``Read`` class has two extra methods, ``readPrec`` and
``readListPrec``, that are not found in the Haskell 2010 since they rely
- on the ``ReadPrec`` data type, which requires the :ghc-flag:`-XRankNTypes`
+ on the ``ReadPrec`` data type, which requires the :extension:`RankNTypes`
extension. GHC also derives ``Read`` instances by implementing ``readPrec``
instead of ``readsPrec``, and relies on a default implementation of
``readsPrec`` that is defined in terms of ``readPrec``. GHC adds these two
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 60f708284a..372e0bd189 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -2450,7 +2450,7 @@ explicit kind annotation must be used (see :ref:`kinding`).
Such data types have only one value, namely bottom. Nevertheless, they
can be useful when defining "phantom types".
-In conjunction with the :ghc-flag:`-XEmptyDataDeriving` extension, empty data
+In conjunction with the :extension:`EmptyDataDeriving` extension, empty data
declarations can also derive instances of standard type classes
(see :ref:`empty-data-deriving`).
@@ -3935,10 +3935,10 @@ Deriving instances for empty data types
Allow deriving instances of standard type classes for empty data types.
One can write data types with no constructors using the
-:ghc-flag:`-XEmptyDataDecls` flag (see :ref:`nullary-types`), which is on by
+:extension:`EmptyDataDecls` flag (see :ref:`nullary-types`), which is on by
default in Haskell 2010. What is not on by default is the ability to derive
type class instances for these types. This ability is enabled through use of
-the :ghc-flag:`-XEmptyDataDeriving` flag. For instance, this lets one write: ::
+the :extension:`EmptyDataDeriving` flag. For instance, this lets one write: ::
data Empty deriving (Eq, Ord, Read, Show)
@@ -3956,16 +3956,16 @@ This would generate the following instances: ::
instance Show Empty where
showsPrec _ x = case x of {}
-The :ghc-flag:`-XEmptyDataDeriving` flag is only required to enable deriving
+The :extension:`EmptyDataDeriving` flag is only required to enable deriving
of these four "standard" type classes (which are mentioned in the Haskell
Report). Other extensions to the ``deriving`` mechanism, which are explained
-below in greater detail, do not require :ghc-flag:`-XEmptyDataDeriving` to be
+below in greater detail, do not require :extension:`EmptyDataDeriving` to be
used in conjunction with empty data types. These include:
-* :ghc-flag:`-XStandaloneDeriving` (see :ref:`stand-alone-deriving`)
+* :extension:`StandaloneDeriving` (see :ref:`stand-alone-deriving`)
* Type classes which require their own extensions to be enabled to be derived,
- such as :ghc-flag:`-XDeriveFunctor` (see :ref:`deriving-extra`)
-* :ghc-flag:`-XDeriveAnyClass` (see :ref:`derive-any-class`)
+ such as :extension:`DeriveFunctor` (see :ref:`deriving-extra`)
+* :extension:`DeriveAnyClass` (see :ref:`derive-any-class`)
.. _deriving-inferred:
@@ -5300,10 +5300,10 @@ In that case, GHC chooses the strategy as follows:
2. For other any type class:
- 1. When ``DeriveAnyClass`` is enabled, use ``anyclass``.
+ 1. When :extension:`DeriveAnyClass` is enabled, use ``anyclass``.
- 2. When ``GeneralizedNewtypeDeriving`` is enabled and we are deriving for a
- newtype, then use ``newytype``.
+ 2. When :extension:`GeneralizedNewtypeDeriving` is enabled and we are
+ deriving for a newtype, then use ``newtype``.
If both rules apply to a deriving clause, then ``anyclass`` is used and the
user is warned about the ambiguity. The warning can be avoided by explicitly
diff --git a/docs/users_guide/intro.rst b/docs/users_guide/intro.rst
index 716fc2794e..b7407b9d20 100644
--- a/docs/users_guide/intro.rst
+++ b/docs/users_guide/intro.rst
@@ -169,4 +169,4 @@ with the ``--version`` flag (see :ref:`options-help`).
The compiler version can be tested within compiled code with the
``MIN_VERSION_GLASGOW_HASKELL`` CPP macro (defined only when
-:ghc-flag:`-XCPP` is used). See :ref:`standard-cpp-macros` for details.
+:extension:`CPP` is used). See :ref:`standard-cpp-macros` for details.
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 335cdcad80..cea8e9b780 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -318,8 +318,8 @@ of ``-W(no-)*``.
.. ghc-flag:: -Wpartial-type-signatures
:shortdesc: warn about holes in partial type signatures when
- :ghc-flag:`-XPartialTypeSignatures` is enabled. Not applicable when
- :ghc-flag:`-XPartialTypesignatures` is not enabled, in which case
+ :extension:`PartialTypeSignatures` is enabled. Not applicable when
+ :extension:`PartialTypesignatures` is not enabled, in which case
errors are generated for such holes. See
:ref:`partial-type-signatures`.
:type: dynamic
@@ -328,7 +328,7 @@ of ``-W(no-)*``.
Determines whether the compiler reports holes in partial type
signatures as warnings. Has no effect unless
- :ghc-flag:`-XPartialTypeSignatures` is enabled, which controls whether
+ :extension:`PartialTypeSignatures` is enabled, which controls whether
errors should be generated for holes in types or not. See
:ref:`partial-type-signatures`.
@@ -768,11 +768,11 @@ of ``-W(no-)*``.
Have the compiler warn if the Prelude is implicitly imported. This happens
unless either the Prelude module is explicitly imported with an ``import
... Prelude ...`` line, or this implicit import is disabled (either by
- :ghc-flag:`-XNoImplicitPrelude` or a ``LANGUAGE NoImplicitPrelude``
+ :extension:`NoImplicitPrelude` or a ``LANGUAGE NoImplicitPrelude``
pragma).
Note that no warning is given for syntax that implicitly refers to the
- Prelude, even if :ghc-flag:`-XNoImplicitPrelude` would change whether it
+ Prelude, even if :extension:`NoImplicitPrelude` would change whether it
refers to the Prelude. For example, no warning is given when ``368`` means
``Prelude.fromInteger (368::Prelude.Integer)`` (where ``Prelude`` refers
to the actual Prelude module, regardless of the imports of the module
@@ -1190,11 +1190,11 @@ of ``-W(no-)*``.
.. ghc-flag:: -Wstar-binder
:shortdesc: warn about binding the ``(*)`` type operator despite
- :ghc-flag:`-XStarIsType`
+ :extension:`StarIsType`
:type: dynamic
:reverse: -Wno-star-binder
- Under :ghc-flag:`-XStarIsType`, a ``*`` in types is not an operator nor
+ Under :extension:`StarIsType`, a ``*`` in types is not an operator nor
even a name, it is special syntax that stands for ``Data.Kind.Type``. This
means that an expression like ``Either * Char`` is parsed as ``Either (*)
Char`` and not ``(*) Either Char``.
@@ -1249,7 +1249,7 @@ of ``-W(no-)*``.
.. ghc-flag:: -Wspace-after-bang
:shortdesc: warn for missing space before the second argument
of an infix definition of ``(!)`` when
- :ghc-flag:`-XBangPatterns` are not enabled
+ :extension:`BangPatterns` are not enabled
:type: dynamic
:reverse: -Wno-missing-space-after-bang
.. ghc-flag:: -Wtabs
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index d97e3bd2e8..9812c455e6 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -714,13 +714,13 @@ messages and in GHCi:
.. ghc-flag:: -fprint-unicode-syntax
:shortdesc: Use unicode syntax when printing expressions, types and kinds.
- See also :ghc-flag:`-XUnicodeSyntax`
+ See also :extension:`UnicodeSyntax`
:type: dynamic
:reverse: -fno-print-unicode-syntax
:category: verbosity
When enabled GHC prints type signatures using the unicode symbols from the
- :ghc-flag:`-XUnicodeSyntax` extension. For instance,
+ :extension:`UnicodeSyntax` extension. For instance,
.. code-block:: none
@@ -732,7 +732,7 @@ messages and in GHCi:
.. ghc-flag:: -fprint-explicit-foralls
:shortdesc: Print explicit ``forall`` quantification in types.
- See also :ghc-flag:`-XExplicitForAll`
+ See also :extension:`ExplicitForAll`
:type: dynamic
:reverse: -fno-print-explicit-foralls
:category: verbosity
@@ -776,7 +776,7 @@ messages and in GHCi:
.. ghc-flag:: -fprint-explicit-kinds
:shortdesc: Print explicit kind foralls and kind arguments in types.
- See also :ghc-flag:`-XKindSignatures`
+ See also :extension:`KindSignatures`
:type: dynamic
:reverse: -fno-print-explicit-kinds
:category: verbosity