docs(book): std iteration and function types #676

Merged
argus merged 1 commit from loop/642-std-iteration into main 2026-10-30 09:50:59 +00:00
Collaborator

Task

Issue #642: the book pages for std/iteration and std/function-types.

  • book/std/iteration.md (order: 80): filter, map and collect; laziness; stopping early; terminal operations; reshaping stages; collectors (counting, summing, averaging, minBy, maxBy, joining, partitioningBy, groupingBy ... then); writing a collector (collector, mergingCollector); making a type iterable; reusable Stages; concatenated.
  • book/std/function-types.md (order: 90): Predicate, Action, Transform as transparent aliases, how type arguments are worked out through the alias, and the shapes that keep their own spelling.
  • book/std/index.md: regenerated with torb docs index book, two new entries.

Every trb run / trb error block is followed by its real output block, produced with the nightly torb (13 blocks in iteration, 6 in function-types; a re-run compares equal).

Old pages

docs/standard-library/iteration.md and docs/standard-library/function-types.md stay in place and unpublished: the skill torbscript-standard-library is generated from docs/standard-library/. No other page changes.

Checks (nightly torb 20261029)

  • torb docs index book --check: 8 indexes, up to date
  • torb docs site book --check --no-native: 49 pages, no broken link
  • torb docs skill docs skills --check: 7 skills, up to date
  • The nightly docs check book rules are outdated (it rejects existing pages), so the book rules were checked by hand: command-call style, no history words, no issue numbers or links into docs/design, docs/contributing or docs/internals, no Related/Next sections, every section starts with a sentence. CI runs the real docs check and gates.sh.

Notes

  • groupingBy { _.key }.then(...) fails with "The checker did not work out the type of this expression"; the page uses a typed key closure ({ order: Order => order.customer }) and says why.
  • The claim that the same Stage also works on std/stream Sources comes from the std doc comment and was not run here.
  • PRs #663 and #675 also touch the generated block of book/std/index.md; re-run torb docs index book after they merge.

Closes #642

## Task Issue #642: the book pages for `std/iteration` and `std/function-types`. - `book/std/iteration.md` (`order: 80`): filter, map and collect; laziness; stopping early; terminal operations; reshaping stages; collectors (`counting`, `summing`, `averaging`, `minBy`, `maxBy`, `joining`, `partitioningBy`, `groupingBy ... then`); writing a collector (`collector`, `mergingCollector`); making a type iterable; reusable `Stage`s; `concatenated`. - `book/std/function-types.md` (`order: 90`): `Predicate`, `Action`, `Transform` as transparent aliases, how type arguments are worked out through the alias, and the shapes that keep their own spelling. - `book/std/index.md`: regenerated with `torb docs index book`, two new entries. Every `trb run` / `trb error` block is followed by its real output block, produced with the nightly `torb` (13 blocks in iteration, 6 in function-types; a re-run compares equal). ## Old pages `docs/standard-library/iteration.md` and `docs/standard-library/function-types.md` stay in place and unpublished: the skill `torbscript-standard-library` is generated from `docs/standard-library/`. No other page changes. ## Checks (nightly torb 20261029) - `torb docs index book --check`: 8 indexes, up to date - `torb docs site book --check --no-native`: 49 pages, no broken link - `torb docs skill docs skills --check`: 7 skills, up to date - The nightly `docs check` book rules are outdated (it rejects existing pages), so the book rules were checked by hand: command-call style, no history words, no issue numbers or links into docs/design, docs/contributing or docs/internals, no Related/Next sections, every section starts with a sentence. CI runs the real `docs check` and `gates.sh`. ## Notes - `groupingBy { _.key }.then(...)` fails with "The checker did not work out the type of this expression"; the page uses a typed key closure (`{ order: Order => order.customer }`) and says why. - The claim that the same `Stage` also works on `std/stream` Sources comes from the std doc comment and was not run here. - PRs #663 and #675 also touch the generated block of `book/std/index.md`; re-run `torb docs index book` after they merge. Closes #642
docs(book): std iteration and function types
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 13s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 39m53s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
9f283fc802
orion requested review from argus 2026-10-30 04:44:32 +00:00
Collaborator

Not mergeable on 9f283fc: rebase onto main (d307c11; likely the generated block of book/std/index.md, re-run torb docs index book); no other blockers.

Not mergeable on 9f283fc: rebase onto main (d307c11; likely the generated block of `book/std/index.md`, re-run `torb docs index book`); no other blockers.
orion removed review request for argus 2026-10-30 06:07:49 +00:00
orion force-pushed loop/642-std-iteration from 9f283fc802
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 13s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 39m53s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to c8b8c4f61a
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 12m16s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 34m52s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-30 06:07:49 +00:00
Compare
orion requested review from argus 2026-10-30 06:07:49 +00:00
Collaborator

Not mergeable on c8b8c4f: rebase onto main (c4cac72; likely the generated block of book/std/index.md, re-run torb docs index book); no other blockers.

Not mergeable on c8b8c4f: rebase onto main (c4cac72; likely the generated block of `book/std/index.md`, re-run `torb docs index book`); no other blockers.
orion force-pushed loop/642-std-iteration from c8b8c4f61a
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 12m16s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 34m52s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to c74a4c44f0
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 10m37s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 31m41s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
2026-10-30 07:28:06 +00:00
Compare
Collaborator

Not mergeable on c74a4c4: rebase onto main (463767c; likely the generated block of book/std/index.md, re-run torb docs index book); no other blockers.

Not mergeable on c74a4c4: rebase onto main (463767c; likely the generated block of `book/std/index.md`, re-run `torb docs index book`); no other blockers.
orion force-pushed loop/642-std-iteration from c74a4c44f0
All checks were successful
ci / commit messages (pull_request) Successful in 5s
ci / what the change touches (pull_request) Successful in 5s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 10m37s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 31m41s
ci / pack the seed (pull_request) Successful in 11s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
to 18e40dbb97
Some checks failed
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 5s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 11s
pdisc / pdisc (push) Has been cancelled
ci / bootstrap (linux-x64) (pull_request) Successful in 8m45s
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / conformance (JavaScript under Node.js) (pull_request) Successful in 10s
ci / tier A (linux-x64) (pull_request) Successful in 33m35s
ci / pack the seed (pull_request) Successful in 10s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
images / cr.torb.dev/torbscript/registry (push) Has been skipped
images / cr.torb.dev/torbscript/release-sync (push) Has been skipped
images / cr.torb.dev/torbscript/site (push) Has been skipped
ci / commit messages (push) Has been cancelled
ci / what the change touches (push) Has been cancelled
ci / gates (push) Has been cancelled
images / cr.torb.dev/torbscript/site:edge (main) (push) Has been cancelled
2026-10-30 08:38:06 +00:00
Compare
argus approved these changes 2026-10-30 09:50:58 +00:00
argus left a comment

Checklist on 18e40db:

  • Tests/CI: ok. Docs-only change; combined status success on this head (gates, pdisc, bootstrap, conformance, commit messages). Every trb run/trb error block is followed by an output block.
  • Correctness: ok. Examples read consistently with their outputs (laziness order, groupBy order, collector results, Stage composition); the one unverified claim (Stage on std/stream) is disclosed in the PR body.
  • Scope = task #642: ok. Two new book pages plus the regenerated book/std/index.md block; old docs/standard-library/ pages stay unpublished with the reason named (skill is generated from them). No other page changed.
  • Book rules: ok. Front matter in the json.md shape, package: set, no issue numbers or links into docs/design/contributing/internals, no Related/Next sections, lists under seven items.
  • Security/data/architecture/placement: n/a.

Non-blocking:

  • function-types.md / iteration.md: the sentence "A stage ... answers an Iterate again" reads oddly; consider "yields a new Iterate".
  • iteration.md "Stages you write once": the std/stream sentence is stated as fact but was not run; consider softening or adding a run block once someone can verify it.
  • PRs #663 and #675 also touch the generated index block; whichever merges later needs torb docs index book re-run (already noted by the author).
Checklist on 18e40db: - Tests/CI: ok. Docs-only change; combined status success on this head (gates, pdisc, bootstrap, conformance, commit messages). Every `trb run`/`trb error` block is followed by an `output` block. - Correctness: ok. Examples read consistently with their outputs (laziness order, `groupBy` order, collector results, `Stage` composition); the one unverified claim (Stage on `std/stream`) is disclosed in the PR body. - Scope = task #642: ok. Two new book pages plus the regenerated `book/std/index.md` block; old `docs/standard-library/` pages stay unpublished with the reason named (skill is generated from them). No other page changed. - Book rules: ok. Front matter in the json.md shape, `package:` set, no issue numbers or links into docs/design/contributing/internals, no Related/Next sections, lists under seven items. - Security/data/architecture/placement: n/a. Non-blocking: - `function-types.md` / `iteration.md`: the sentence "A stage ... answers an `Iterate` again" reads oddly; consider "yields a new `Iterate`". - `iteration.md` "Stages you write once": the `std/stream` sentence is stated as fact but was not run; consider softening or adding a run block once someone can verify it. - PRs #663 and #675 also touch the generated index block; whichever merges later needs `torb docs index book` re-run (already noted by the author).
argus merged commit 18e40dbb97 into main 2026-10-30 09:50:59 +00:00
argus deleted branch loop/642-std-iteration 2026-10-30 09:50:59 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!676
No description provided.