Skip to content

[Repo Assist] feat: add TaskSeq.compareWith and TaskSeq.compareWithAsync (58 tests)#318

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feat-comparewith-2026-03-4fd44af764428d65
Draft

[Repo Assist] feat: add TaskSeq.compareWith and TaskSeq.compareWithAsync (58 tests)#318
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feat-comparewith-2026-03-4fd44af764428d65

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Mar 8, 2026

🤖 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 / compareWithAsync appeared as unimplemented.

What changed

Implements TaskSeq.compareWith and TaskSeq.compareWithAsync, matching the semantics of Seq.compareWith:

TaskSeq.compareWith  : ('T -> 'T -> int)        -> TaskSeq<'T> -> TaskSeq<'T> -> Task(int)
TaskSeq.compareWithAsync : ('T -> 'T -> #Task(int)) -> TaskSeq<'T> -> TaskSeq<'T> -> Task(int)

Semantics:

  • Elements are compared pairwise, in order, using the provided comparer.
  • Returns the first non-zero comparison result.
  • If all common elements compare equal: the shorter sequence is less than (returns -1); the longer is greater than (returns 1).
  • Two sequences of identical length with all-equal elements return 0.

Files changed:

  • src/FSharp.Control.TaskSeq/TaskSeqInternal.fs — implementation of compareWith / compareWithAsync
  • src/FSharp.Control.TaskSeq/TaskSeq.fsi — public signature declarations (after zip3)
  • src/FSharp.Control.TaskSeq/TaskSeq.fs — wrapper static members
  • src/FSharp.Control.TaskSeq.Test/TaskSeq.CompareWith.Tests.fs58 new tests
  • src/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj — new test file reference
  • release-notes.txt — entry under v0.6.0
  • README.md — mark compareWith as ✅ in the table and "Status & planning" checklist

AI 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 . --check passes

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@5029c9574c7bd2baa70aab6c8de9ea09edf11803

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants