[Repo Assist] feat: add TaskSeq.compareWith and TaskSeq.compareWithAsync (58 tests)#318
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
Conversation
Implements Seq.compareWith equivalents for task sequences:
- TaskSeq.compareWith : ('T -> 'T -> int) -> TaskSeq<'T> -> TaskSeq<'T> -> Task<int>
- TaskSeq.compareWithAsync : ('T -> 'T -> #Task<int>) -> TaskSeq<'T> -> TaskSeq<'T> -> Task<int>
Semantics match Seq.compareWith:
- Elements are compared pairwise in order.
- Returns the first non-zero comparison result.
- If all compared elements are equal, the shorter sequence is considered
less than (returns -1) and the longer sequence is greater (returns 1).
- Two sequences of equal length with equal elements return 0.
Also adds 58 tests covering: null args, empty sequences, equal sequences,
length differences, early termination, custom comparer values, and async variant.
Updates README to mark compareWith as implemented and release-notes.txt.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23 tasks
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 is a draft PR from Repo Assist, an automated AI assistant.
Closes (conceptually — no explicit issue) the long-standing gap in the README table where
compareWith/compareWithAsyncappeared as unimplemented.What changed
Implements
TaskSeq.compareWithandTaskSeq.compareWithAsync, matching the semantics ofSeq.compareWith:Semantics:
-1); the longer is greater than (returns1).0.Files changed:
src/FSharp.Control.TaskSeq/TaskSeqInternal.fs— implementation ofcompareWith/compareWithAsyncsrc/FSharp.Control.TaskSeq/TaskSeq.fsi— public signature declarations (afterzip3)src/FSharp.Control.TaskSeq/TaskSeq.fs— wrapper static memberssrc/FSharp.Control.TaskSeq.Test/TaskSeq.CompareWith.Tests.fs— 58 new testssrc/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj— new test file referencerelease-notes.txt— entry under v0.6.0README.md— markcompareWithas ✅ in the table and "Status & planning" checklistAI Disclosure
This PR was created by Repo Assist, an automated AI assistant.
Test Status
✅ Build: succeeded (Release configuration,
netstandard2.1)✅ Tests: 4588 passed, 2 skipped (existing skips), 0 failed — full suite run with
dotnet test -c Release✅ Formatting:
dotnet fantomas . --checkpasses