Conversation
- isEmpty: checks if sequence has no elements; short-circuits after the first - tryHead: returns first element as option (mirrors Seq.tryHead / alias for tryFirst) - except: filters out elements present in a given collection (mirrors Seq.except) All 276 tests pass (267 pre-existing + 9 new). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3 tasks
…471744-646c6897389cdfcb
github-actions bot
added a commit
that referenced
this pull request
Mar 3, 2026
…→ 4.6.0 - Fix merge conflict in RELEASE_NOTES.md (4.6.0 section had unresolved conflict markers from concurrent PRs #261 and #264 merging into main) - Bump version.props from 4.5.0 to 4.6.0 to cover all unreleased additions merged since the 4.5.0 version bump: - PR #261: findIndex, tryFindIndex, findIndexAsync, tryFindIndexAsync, sortWith - PR #264: isEmpty, tryHead, except All 287 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dsyme
pushed a commit
that referenced
this pull request
Mar 4, 2026
…OTES.md, bump version 4.5.0 → 4.6.0 (#265) * Prepare release 4.6.0 — fix merge conflict, bump version.props 4.5.0 → 4.6.0 - Fix merge conflict in RELEASE_NOTES.md (4.6.0 section had unresolved conflict markers from concurrent PRs #261 and #264 merging into main) - Bump version.props from 4.5.0 to 4.6.0 to cover all unreleased additions merged since the 4.5.0 version bump: - PR #261: findIndex, tryFindIndex, findIndexAsync, tryFindIndexAsync, sortWith - PR #264: isEmpty, tryHead, except All 287 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds three new combinators to
AsyncSeq, filling gaps relative to the standardSeqmodule:isEmptytrueif the sequence is empty; short-circuits after the first elementSeq.isEmptytryHeadoption, orNoneif emptySeq.tryHeadexceptSeq.exceptImplementation Notes
isEmptyis O(1) for non-empty sequences — it advances the enumerator exactly once and disposes it, making it far more efficient thanlength = 0ortoArray().Length = 0.tryHeadis a direct alias for the existingtryFirst, providing the standardSeq-module name. Both names are now available.exceptbuilds aHashSet<'T>from the excluded collection up front (O(n) once), then filters the source in O(1) per element. Requires'T : equality.Test Status
Build: ✅ succeeded (0 errors, 1 pre-existing warning on
groupByAsync)Tests: ✅ 276/276 passed (267 pre-existing + 9 new)
New tests cover:
isEmptyon empty, non-empty, and singleton sequences (3 tests)tryHeadon empty and non-empty sequences (2 tests)exceptwith partial exclusion, no exclusion, full exclusion, and empty source (4 tests)