feat: introduce Sequence type - #24
Merged
Merged
Conversation
nikophil
commented
Jul 20, 2026
nikophil
commented
Jul 20, 2026
nikophil
force-pushed
the
feature/sequence
branch
2 times, most recently
from
July 20, 2026 09:53
9b1e767 to
fc13614
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
nikophil
commented
Jul 20, 2026
nikophil
force-pushed
the
feature/sequence
branch
from
July 20, 2026 10:02
fc13614 to
5c9dafa
Compare
nikophil
marked this pull request as ready for review
July 20, 2026 10:03
delacry
requested changes
Jul 25, 2026
nikophil
added a commit
to nikophil/collection
that referenced
this pull request
Jul 26, 2026
The lastProduced guard only remembers the previous pass's iterator, so a producer alternating between two exhausted generators bypasses it and PHP's raw 'Cannot traverse an already closed generator' surfaces instead of SequenceAlreadyIteratedException. Accepted limitation (catching it would require tracking every produced iterator, i.e. unbounded memory); requested in PR noctud#24 review.
The lastProduced guard only remembers the previous pass's iterator, so a producer alternating between two exhausted generators bypasses it and PHP's raw 'Cannot traverse an already closed generator' surfaces instead of SequenceAlreadyIteratedException. Accepted limitation (catching it would require tracking every produced iterator, i.e. unbounded memory); requested in PR noctud#24 review.
…leaks_the_raw_php_error
nikophil
force-pushed
the
feature/sequence
branch
from
July 26, 2026 14:26
a39f7a0 to
9b2b05c
Compare
delacry
requested changes
Jul 26, 2026
nikophil
force-pushed
the
feature/sequence
branch
from
July 26, 2026 17:29
9b2b05c to
f04cec2
Compare
delacry
approved these changes
Jul 26, 2026
delacry
left a comment
Member
There was a problem hiding this comment.
Thank you, this looks awesome!
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.
see #23
Here is a first PR which paves the way for lazy sequences: new type is created + iteration ("re-playability" handled) + 2 intermediates (
filter()andmap()) and few terminals (toArray(),toList(),toSet()I think this is enough for a first iteration, so that we can discuss on concrete code