Commit 5adf8f3b authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Document -fmax-pmcheck-iterations a bit better

parent a48ebcc4
......@@ -352,7 +352,7 @@ Compiler
the pattern match checker iterates. Since coverage checking is exponential
in the general case, setting a default number of iterations prevents memory
and performance blowups. By default, the number of iterations is set to
10000000 but it can be set to ``n`` with: ``-fmax-pmcheck-iterations=n``.
2000000 but it can be set with: ``-fmax-pmcheck-iterations=<n>``.
If the set number of iterations is exceeded, an informative warning is
issued.
......
......@@ -516,6 +516,18 @@ of ``-W(no-)*``.
h = \[] -> 2
Just k = f y
.. ghc-flag:: -fmax-pmcheck-iterations=<N>
:default: 2000000
Sets how many iterations of the pattern-match checker will perform before
giving up. This limit is to catch cases where pattern-match checking might
be excessively costly (due to the exponential complexity of coverage
checking in the general case). It typically shouldn't be necessary to set
this unless GHC informs you that it has exceeded the pattern match checker's
iteration limit (in which case you may want to consider refactoring your
pattern match, for the sake of future readers of your code.
.. ghc-flag:: -Wincomplete-record-updates
.. index::
......
......@@ -117,6 +117,11 @@ warningsOptions =
, flagType = DynamicFlag
, flagReverse = "-Wno-incomplete-uni-patterns"
}
, flag { flagName = "-Wmax-pmcheck-iterations=<N>"
, flagDescription =
"the iteration limit for the pattern match checker"
, flagType = DynamicFlag
}
, flag { flagName = "-Wincomplete-record-updates"
, flagDescription = "warn when a record update could fail"
, flagType = DynamicFlag
......
Markdown is supported
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