[Git][ghc/ghc][wip/gc-events] users guide: Fix syntax errors
Ben Gamari
gitlab at gitlab.haskell.org
Wed Dec 9 21:34:17 UTC 2020
Ben Gamari pushed to branch wip/gc-events at Glasgow Haskell Compiler / GHC
Commits:
8087a524 by Ben Gamari at 2020-12-09T16:34:11-05:00
users guide: Fix syntax errors
Fixes errors introduced by 3a55b3a2574f913d046f3a6f82db48d7f6df32e3.
- - - - -
1 changed file:
- docs/users_guide/using-optimisation.rst
Changes:
=====================================
docs/users_guide/using-optimisation.rst
=====================================
@@ -1197,16 +1197,16 @@ by saying ``-fno-wombat``.
This is the full syntax for cardinalities, demands and sub-demands in BNF:
- .. code-block::
+ .. code-block:: none
- card ::= B | A | 1 | U | S | M semantics as in the table above
+ card ::= B | A | 1 | U | S | M semantics as in the table above
- d ::= card sd card = how often, sd = how deep
- | card abbreviation: Same as "card card"
+ d ::= card sd card = how often, sd = how deep
+ | card abbreviation: Same as "card card"
- sd ::= card polymorphic sub-demand, card at every level
- | P(d,d,..) product sub-demand
- | Ccard(sd) call sub-demand
+ sd ::= card polymorphic sub-demand, card at every level
+ | P(d,d,..) product sub-demand
+ | Ccard(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
@@ -1234,17 +1234,17 @@ by saying ``-fno-wombat``.
We summarise a function's demand properties in its *demand signature*.
This is the general syntax:
- .. code-block::
+ .. code-block:: none
- {x->dx,y->dy,z->dz...}<d1><d2><d3>...<dn>div
- ^ ^ ^ ^ ^ ^
- | | | | | |
- | \---+---+------/ |
- | | |
- demand on free demand on divergence
- variables arguments information
- (omitted if empty) (omitted if
- no information)
+ {x->dx,y->dy,z->dz...}<d1><d2><d3>...<dn>div
+ ^ ^ ^ ^ ^ ^
+ | | | | | |
+ | \---+---+------/ |
+ | | |
+ demand on free demand on divergence
+ variables arguments information
+ (omitted if empty) (omitted if
+ no information)
We summarise ``fst``'s demand properties in its *demand signature*
``<SP(SU,A)>``, which just says "If ``fst`` is applied to one argument,
@@ -1260,13 +1260,11 @@ by saying ``-fno-wombat``.
**Call sub-demands**
- Consider ``maybe``:
+ Consider ``maybe``: ::
- .. code-block::
-
- maybe :: b -> (a -> b) -> Maybe a -> b
- maybe n _ Nothing = n
- maybe _ s (Just a) = s a
+ maybe :: b -> (a -> b) -> Maybe a -> b
+ maybe n _ Nothing = n
+ maybe _ s (Just a) = s a
We give it demand signature ``<U><1C1(U)><SU>``. The ``C1(U)`` is a *call
sub-demand* that says "Called at most once, where the result is used
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8087a524c35af0f6fa04e2e1bbc5a0a726c91b72
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8087a524c35af0f6fa04e2e1bbc5a0a726c91b72
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201209/17907faa/attachment-0001.html>
More information about the ghc-commits
mailing list