diff options
author | Sebastian Graf <sebastian.graf@kit.edu> | 2022-09-28 16:36:08 +0200 |
---|---|---|
committer | Sebastian Graf <sebastian.graf@kit.edu> | 2022-09-29 17:04:20 +0200 |
commit | 5a535172d13b30c94766751d0bc21a494b8858ed (patch) | |
tree | 6054a3cbc51276b4ad230ca25356b591b4176291 /docs | |
parent | 6a2eec98d9f5c3f5d735042f0d7bb65d0dbb3323 (diff) | |
download | haskell-5a535172d13b30c94766751d0bc21a494b8858ed.tar.gz |
Demand: Format Call SubDemands `Cn(sd)` as `C(n,sd)` (#22231)wip/T22231
Justification in #22231. Short form: In a demand like `1C1(C1(L))`
it was too easy to confuse which `1` belongs to which `C`. Now
that should be more obvious.
Fixes #22231
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/using-optimisation.rst | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/users_guide/using-optimisation.rst b/docs/users_guide/using-optimisation.rst index b5f8c5bb29..d3ca68a1df 100644 --- a/docs/users_guide/using-optimisation.rst +++ b/docs/users_guide/using-optimisation.rst @@ -1354,7 +1354,7 @@ by saying ``-fno-wombat``. sd ::= card polymorphic sub-demand, card at every level | P(d,d,..) product sub-demand - | Ccard(sd) call sub-demand + | C(card,sd) call sub-demand For example, ``fst`` is strict in its argument, and also in the first component of the argument. It will not evaluate the argument's second @@ -1414,14 +1414,14 @@ by saying ``-fno-wombat``. maybe n _ Nothing = n maybe _ s (Just a) = s a - We give it demand signature ``<L><MCM(L)><1L>``. The ``CM(L)`` is a *call + We give it demand signature ``<L><MC(M,L)><1L>``. The ``C(M,L)`` is a *call sub-demand* that says "Called at most once, where the result is used according to ``L``". The expression ``f `seq` f 1`` puts ``f`` under - demand ``SC1(L)`` and serves as an example where the upper bound on + demand ``SC(1,L)`` and serves as an example where the upper bound on evaluation cardinality doesn't coincide with that of the call cardinality. Cardinality is always relative to the enclosing call cardinality, so - ``g 1 2 + g 3 4`` puts ``g`` under demand ``SCS(C1(L))``, which says + ``g 1 2 + g 3 4`` puts ``g`` under demand ``SC(S,C(1,L))``, which says "called multiple times (``S``), but every time it is called with one argument, it is applied exactly once to another argument (``1``)". |