From 4435a8e0b74337fe5faddb9c46691f0f5bf9e653 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Sun, 29 Dec 2019 15:16:24 -0500 Subject: 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 --- docs/users_guide/using-warnings.rst | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'docs') 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 + ` + 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 ` 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 ` are enabled. This option is enabled by -- cgit v1.2.1