summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTom Ellis <tom-git@jaguarpaw.co.uk>2023-01-21 11:30:16 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-24 12:10:52 -0500
commit05e6a2d939f5f9d468122a6fd9e9514668f3fc20 (patch)
tree8edd7b0bd5403b56aa52bb0bde490f5e67550deb /docs
parent1c050ed26f50f3a8788e650f23d6ff55badc1072 (diff)
downloadhaskell-05e6a2d939f5f9d468122a6fd9e9514668f3fc20.tar.gz
Clarify where `f` is defined
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using-warnings.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/users_guide/using-warnings.rst b/docs/users_guide/using-warnings.rst
index 7c288d3767..2c70006a7c 100644
--- a/docs/users_guide/using-warnings.rst
+++ b/docs/users_guide/using-warnings.rst
@@ -2057,10 +2057,13 @@ of ``-W(no-)*``.
:since: 8.4
- The option :ghc-flag:`-Wpartial-fields` warns about record fields that could
- fail when accessed via a lacking constructor. The function ``f`` below will
- fail when applied to ``Bar``, so the compiler will emit a warning at its
- definition when :ghc-flag:`-Wpartial-fields` is enabled.
+ The option :ghc-flag:`-Wpartial-fields` warns about a record field
+ `f` that is defined in some, but not all, the contructors of a
+ data type, because `f`'s record selector function may fail. For
+ exampe, the record selector function `f`, defined in the `Foo`
+ constructor record below, will fail when applied to ``Bar``, so
+ the compiler will emit a warning at its definition when
+ :ghc-flag:`-Wpartial-fields` is enabled.
The warning is suppressed if the field name begins with an underscore. ::