Repository navigation
Add Sequence documentation - #52
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nikophil
approved these changes
Oct 5, 2026
delacry
force-pushed
the
feature/sequence-docs
branch
from
October 9, 2026 20:07
60344bb to
6dfea6f
Compare
delacry
marked this pull request as ready for review
October 9, 2026 20:22
nikophil
approved these changes
Oct 10, 2026
Member
Author
|
Thanks for the review and for all the work you did on Sequences! I'm preparing to do last 0.1.x release so it's easier to upgrade to 0.2 when released, but before that I would like to also resolve #49, since it introduces some BC breaks, after that is merged I'll play around with the 0.2.x for a bit to test it all as a whole, and maybe next week I'll tag it. |
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.
Documents
Sequence, the last remaining item from #23.New pages
/collection/sequence):asSequence(),sequenceOf()orgenerateSequence()onEach()vsforEach(), and memory useconstrainOncesorted()/collection/api/sequence): every method, how much of thesource each one pulls, and a "Not available on Sequence" table with the
materialize-first equivalents
Updated pages
Sequencein the architecture tree, and anasSequence()tipin Transforming
constrainOnce),Design (new "No Hidden Materialization" section), FAQ (2 entries), Extending
(
SequenceLogic), Cheatsheet, Factory Functions, Map APIsection, and
Sequence<E>in the hero imageSearch
Searching "lazy collections" used to land on Lazy Initialization. The FAQ now has
"Are there lazy collections, like Laravel's
LazyCollection?", and a page can setsearchTitlein its frontmatter to change its title in the search index only (asmall
_renderhook inconfig.mts). The Sequence guide is indexed as"Sequence — Lazy Collections" and is now the first result.
Terminology
The docs no longer use "lazy collection" for lazy initialization. Lazy
initialization defers when a collection is loaded; a sequence changes how a
chain runs. In PHP, "lazy collection" usually means Laravel's
LazyCollection,which is the equivalent of our
Sequence.Also fixed
elementAt(),elementAtOrNull()andasSequence()were missing from theCollection API page
/collection/lazy-collectionsdesign.mdnamed operation classes that don't exist (SortOperation,MapOperation)Verification
// resultcomment was run against 0.2.xSequencemethods are documented, and their signatures match the interfacechecked with scripts against the implementation
vitepress buildpasses and all internal links resolveChecking the examples against the code turned up a bug:
distinct()droppeddistinct objects when they were streamed, because a freed object's ID gets
reused. It's fixed in #50, with regression tests in #51.
Reviewing
Most of the content is in
docs/collection/sequence.md, the guide; read that onein full. The API page is reference material that you can skim. The rest are short
additions, plus mechanical "lazy collection" → "lazy initialization" renames.
Closes #23