diff options
author | Tom Ellis <tom-git@jaguarpaw.co.uk> | 2023-01-21 11:30:16 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-01-24 12:10:52 -0500 |
commit | 05e6a2d939f5f9d468122a6fd9e9514668f3fc20 (patch) | |
tree | 8edd7b0bd5403b56aa52bb0bde490f5e67550deb /docs | |
parent | 1c050ed26f50f3a8788e650f23d6ff55badc1072 (diff) | |
download | haskell-05e6a2d939f5f9d468122a6fd9e9514668f3fc20.tar.gz |
Clarify where `f` is defined
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/using-warnings.rst | 11 |
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. :: |