Commit 05e6a2d9 authored by Tom Ellis's avatar Tom Ellis Committed by Marge Bot
Browse files

Clarify where `f` is defined

parent 1c050ed2
Pipeline #62039 canceled with stages
in 39 seconds
......@@ -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. ::
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment