diff options
author | sternenseemann <sternenseemann@systemli.org> | 2022-10-16 01:32:55 +0200 |
---|---|---|
committer | sternenseemann <sternenseemann@systemli.org> | 2022-10-16 14:29:12 +0200 |
commit | d0f2da214badd4cded6fb00e97af4588da49c0d0 (patch) | |
tree | 392762410e636a98331a5eccd25f57a79729dc94 /tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp | |
parent | ac0fb38e8a5a25a84fa17704bd31b453211263eb (diff) |
primops: make nature of foldl' strictness clearer
* Clarify the documentation of foldl': That the arguments are forced
before application (?) of `op` is necessarily true. What is important
to stress is that we force every application of `op`, even when the
value turns out to be unused.
* Move the example before the comment about strictness to make it less
confusing: It is a general example and doesn't really showcase anything
about foldl' strictness.
* Add test cases which nail down aspects of foldl' strictness:
* The initial accumulator value is not forced unconditionally.
* Applications of op are forced.
* The list elements are not forced unconditionally.
Diffstat (limited to 'tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp')
-rw-r--r-- | tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp b/tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp new file mode 100644 index 000000000..d81cc0710 --- /dev/null +++ b/tests/lang/eval-okay-foldlStrict-lazy-initial-accumulator.exp @@ -0,0 +1 @@ +42 |