summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-02-14 15:34:56 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-04 23:14:01 -0500
commitdb898c8a33813f4bdfbd38fe7595fbdd819c172a (patch)
treebd6a3a1c90a0af3d6cee1b80c44b5c367692ca74 /docs
parentf943edb0c40d20e1330450c3e148b8d0c877eded (diff)
downloadhaskell-db898c8a33813f4bdfbd38fe7595fbdd819c172a.tar.gz
Add a Template Haskell warning flag -Wimplicit-lift
Part of #17804.
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/9.2.1-notes.rst3
-rw-r--r--docs/users_guide/using-warnings.rst17
2 files changed, 20 insertions, 0 deletions
diff --git a/docs/users_guide/9.2.1-notes.rst b/docs/users_guide/9.2.1-notes.rst
index c590a89d31..5e0bf1c317 100644
--- a/docs/users_guide/9.2.1-notes.rst
+++ b/docs/users_guide/9.2.1-notes.rst
@@ -79,6 +79,9 @@ Compiler
since the argument was already forced in the first equation. For more
details see :ghc-flag:`-Wredundant-bang-patterns`.
+- New :ghc-flag:`-Wimplicit-lift` flag which warns when a Template Haskell quote
+ implicitly uses ``lift``.
+
- New :ghc-flag:`-finline-generics` and
:ghc-flag:`-finline-generics-aggressively` flags for improving performance of
generics-based algorithms.
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index c0345fb958..9771837b93 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -113,6 +113,7 @@ The following flags are simple ways to select standard "packages" of warnings:
* :ghc-flag:`-Wunused-packages`
* :ghc-flag:`-Wunused-type-patterns`
* :ghc-flag:`-Wsafe`
+ * :ghc-flag:`-Wimplicit-lift`
.. ghc-flag:: -Weverything
:shortdesc: enable all warnings supported by GHC
@@ -856,6 +857,22 @@ of ``-W(no-)*``.
f :: forall k (a :: k). Proxy a
+.. ghc-flag:: -Wimplicit-lift
+ :shortdesc: warn about implicit ``lift`` in Template Haskell quotes
+ :type: dynamic
+ :reverse: -Wno-implicit-lift
+ :category: warnings
+
+ :since: 9.2
+
+ Template Haskell quotes referring to local variables bound outside
+ of the quote are implicitly converted to use ``lift`. For example,
+ ``f x = [| reverse x |]`` becomes ``f x = [| reverse $(lift x) |])``.
+ This flag issues a warning for every such implicit addition of ``lift``.
+ This can be useful when debugging more complex staged programs,
+ where an implicit `lift`` can accidentally conceal a variable
+ used at a wrong stage.
+
.. ghc-flag:: -Wimplicit-prelude
:shortdesc: warn when the Prelude is implicitly imported
:type: dynamic