Repository navigation
Define the functions the pipelines chapter pipes through - #625
Merged
Merged
Conversation
docs/book/06-pipelines-and-results.md had seven unverified blocks and now has
none.
The chapter pipes values through `increment`, `double`, `add` and `clamp`
from 6.1 onward and never showed three of them. A reader following along had
nothing to type. They are defined once now, where they are first needed,
which is a line the chapter wanted anyway:
function increment(x: i32) -> i32 { return x + 1 }
function double(x: i32) -> i32 { return x * 2 }
function add(x: i32, k: i32) -> i32 { return x + k }
6.2 pipes a `raw` reading through clamp without introducing it. It is a fixed
input, so `const raw: i32 = 137` says what it is, and the desugared block
below reads the same value rather than a name from nowhere.
Two blocks stay notation, because they cannot be anything else: `x |> f`,
`x |> f()` and `x |> f(y)` show the same statement written three ways over
names standing for any function and any value, and `f` is one arity in one
line and another in the next.
unverified: 159 -> 153.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Keep the chapter-6 content fix, take #624's chapter-13 work and current ledger from main, and avoid a generated-ledger merge conflict.
godofecht
added a commit
that referenced
this pull request
Aug 20, 2026
Take the focused, green chapter-6 fix from #625 and keep the remaining audit work on top of current main.
godofecht
added a commit
that referenced
this pull request
Sep 7, 2026
Take the focused, green chapter-6 fix from #625 and keep the remaining audit work on top of current main.
godofecht
added a commit
that referenced
this pull request
Sep 7, 2026
Take the focused, green chapter-6 fix from #625 and keep the remaining audit work on top of current main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs/book/06-pipelines-and-results.mdhad seven unverified blocks and now has none.unverified: 159 -> 153.Defined rather than worked around, since the language leaves room to define all of it.
Three functions the chapter never showed
It pipes values through
increment,double,addandclampfrom 6.1 onward, and showed onlyclamp. A reader following along had nothing to type:They are defined once now, where they are first needed:
A reading from nowhere
6.2 pipes
rawthroughclampand never introduces it. It is a fixed input, soconst raw: i32 = 137says what it is, and the "It compiles as" block below now reads that same value instead of a free name.constrather thanlet, because a module-level binding must be one orlet mut, and the reading does not change.Two blocks stay notation
They cannot be anything else:
That is the same statement written three ways over names standing for any function and any value, and
ftakes one argument on one line and two on the next. No definition satisfies both.Verification
check_doc_examples.py --check-ledgerpytest tests/unit/test_docs_blocks.py