X Tutup
Skip to content

[Repo Assist] feat: add TaskSeq.exists2, forall2, forall2Async, fold2, fold2Async (206 tests)#324

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feat-exists2-forall2-fold2-2026-03-6d44711ef330cad2
Draft

[Repo Assist] feat: add TaskSeq.exists2, forall2, forall2Async, fold2, fold2Async (206 tests)#324
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/feat-exists2-forall2-fold2-2026-03-6d44711ef330cad2

Conversation

@github-actions
Copy link
Contributor

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

🤖 This is a draft PR from Repo Assist, an automated AI assistant.

Implements the next batch of '2'-functions from the README roadmap, following the map2/iter2 batch (PR #322):

TaskSeq.exists2     : ('T -> 'U -> bool)            -> TaskSeq<'T> -> TaskSeq<'U> -> Task(bool)
TaskSeq.forall2     : ('T -> 'U -> bool)            -> TaskSeq<'T> -> TaskSeq<'U> -> Task(bool)
TaskSeq.forall2Async: ('T -> 'U -> #Task(bool))     -> TaskSeq<'T> -> TaskSeq<'U> -> Task(bool)
TaskSeq.fold2       : ('State -> 'T -> 'U -> 'State) -> 'State -> TaskSeq<'T> -> TaskSeq<'U> -> Task<'State>
TaskSeq.fold2Async  : ('State -> 'T -> 'U -> #Task<'State>) -> 'State -> TaskSeq<'T> -> TaskSeq<'U> -> Task<'State>

Semantics: when the two input sequences have different lengths, iteration stops at the shorter sequence — extra elements of the longer sequence are silently ignored. This is consistent with zip, map2, and iter2.

Note: exists2 has no async variant (matching the F# standard library pattern for Seq.exists2).

Files changed

  • src/FSharp.Control.TaskSeq/TaskSeqInternal.fsfold2, fold2Async, forall2, forall2Async, exists2 implementations; placed adjacent to fold, forall, exists respectively
  • src/FSharp.Control.TaskSeq/TaskSeq.fs — wrapper static members
  • src/FSharp.Control.TaskSeq/TaskSeq.fsi — public signatures with XML doc; placed after their single-source counterparts
  • src/FSharp.Control.TaskSeq.Test/TaskSeq.Exists2Forall2Fold2.Tests.fs206 new tests: null checks, empty sequences (both/first/second empty), truncation at shorter sequence, type mixing, side-effect sequences, early-exit behaviour
  • 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 exists2, fold2/fold2Async, forall2/forall2Async as ✅ in the table; update checklist

AI Disclosure

This PR was created by Repo Assist, an automated AI assistant.

Test Status

Build: succeeded (Release configuration, netstandard2.1)
Tests: 4736 passed, 2 skipped (existing skips), 0 failed — full suite
New tests: 206 tests across exists2, forall2/forall2Async, fold2/fold2Async
Formatting: dotnet fantomas . --check passes

Generated by Repo Assist ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

…206 tests)

Implements the next batch of '2'-functions from the README roadmap:

  TaskSeq.exists2     : ('T -> 'U -> bool)          -> TaskSeq<'T> -> TaskSeq<'U> -> Task<bool>
  TaskSeq.forall2     : ('T -> 'U -> bool)          -> TaskSeq<'T> -> TaskSeq<'U> -> Task<bool>
  TaskSeq.forall2Async: ('T -> 'U -> #Task<bool>)   -> TaskSeq<'T> -> TaskSeq<'U> -> Task<bool>
  TaskSeq.fold2       : ('S -> 'T -> 'U -> 'S)      -> 'S -> TaskSeq<'T> -> TaskSeq<'U> -> Task<'S>
  TaskSeq.fold2Async  : ('S -> 'T -> 'U -> #Task<'S>) -> 'S -> TaskSeq<'T> -> TaskSeq<'U> -> Task<'S>

Semantics: stop at the shorter sequence (consistent with map2/iter2/zip).

Files changed:
- TaskSeqInternal.fs: exists2, forall2, forall2Async, fold2, fold2Async
- TaskSeq.fs: wrapper members
- TaskSeq.fsi: public signatures with XML doc
- TaskSeq.Exists2Forall2Fold2.Tests.fs: 206 tests (null, empty, immutable, side-effects)
- FSharp.Control.TaskSeq.Test.fsproj: new test file reference
- release-notes.txt: entry under v0.6.0
- README.md: mark exists2, fold2/fold2Async, forall2/forall2Async as done

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

X Tutup