summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-12-29 15:16:24 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-08 10:17:55 -0500
commit4435a8e0b74337fe5faddb9c46691f0f5bf9e653 (patch)
tree1d8ac7f540770c017f5e26f51d2788666203fbed /docs
parentaede171a59f9b7b8022548c385a1cb8c4589f905 (diff)
downloadhaskell-4435a8e0b74337fe5faddb9c46691f0f5bf9e653.tar.gz
Introduce -Wcompat-unqualified-imports
This implements the warning proposed in option (B) of the Data.List.singleton CLC [discussion][]. This warning, which is included in `-Wcompat` is intended to help users identify imports of modules that will change incompatibly in future GHC releases. This currently only includes `Data.List` due to the expected specialisation and addition of `Data.List.singleton`. Fixes #17244. [discussion]: https://groups.google.com/d/msg/haskell-core-libraries/q3zHLmzBa5E/PmlAs_kYAQAJ
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using-warnings.rst25
1 files changed, 22 insertions, 3 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 586af57136..aab74d36c2 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -124,6 +124,7 @@ The following flags are simple ways to select standard "packages" of warnings:
* :ghc-flag:`-Wsemigroup`
* :ghc-flag:`-Wnoncanonical-monoid-instances`
* :ghc-flag:`-Wstar-is-type`
+ * :ghc-flag:`-Wcompat-unqualified-imports`
.. ghc-flag:: -Wno-compat
:shortdesc: Disables all warnings enabled by :ghc-flag:`-Wcompat`.
@@ -219,12 +220,31 @@ of ``-W(no-)*``.
encountered on the command line.
:type: dynamic
:reverse: -Wno-unrecognised-warning-flags
+ :default: on
:category:
Enables warnings when the compiler encounters a ``-W...`` flag that is not
recognised.
- This warning is on by default.
+.. ghc-flag:: -Wcompat-unqualified-imports
+ :shortdesc: Report unqualified imports of core libraries which are expected
+ to cause compatibility problems in future releases.
+ :type: dynamic
+ :reverse: -Wno-compat-unqualified-imports
+ :category:
+
+ Warns on qualified imports of core library modules which are subject to
+ change in future GHC releases. Currently the following modules are covered
+ by this warning:
+
+ - ``Data.List`` due to the future addition of ``Data.List.singleton`` and
+ specialisation of exports to the ``[]`` type. See the
+ :ref:`mailing list
+ <https://groups.google.com/forum/#!topic/haskell-core-libraries/q3zHLmzBa5E>`
+ for details.
+
+ This warning can be addressed by either adding an explicit import list or
+ using a ``qualified`` import.
.. ghc-flag:: -Wtyped-holes
:shortdesc: Report warnings when :ref:`typed hole <typed-holes>` errors are
@@ -232,14 +252,13 @@ of ``-W(no-)*``.
:ghc-flag:`-fdefer-typed-holes`.
:type: dynamic
:reverse: -Wno-typed-holes
+ :default: on
:category:
Determines whether the compiler reports typed holes warnings. Has no
effect unless typed holes errors are deferred until runtime. See
:ref:`typed-holes` and :ref:`defer-type-errors`
- This warning is on by default.
-
.. ghc-flag:: -Wdeferred-type-errors
:shortdesc: Report warnings when :ref:`deferred type errors
<defer-type-errors>` are enabled. This option is enabled by