[Repo Assist] feat: add TaskSeq.exists2, forall2, forall2Async, fold2, fold2Async (206 tests)#324
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
…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>
13 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.
Implements the next batch of
'2'-functionsfrom the README roadmap, following themap2/iter2batch (PR #322):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, anditer2.Note:
exists2has no async variant (matching the F# standard library pattern forSeq.exists2).Files changed
src/FSharp.Control.TaskSeq/TaskSeqInternal.fs—fold2,fold2Async,forall2,forall2Async,exists2implementations; placed adjacent tofold,forall,existsrespectivelysrc/FSharp.Control.TaskSeq/TaskSeq.fs— wrapper static memberssrc/FSharp.Control.TaskSeq/TaskSeq.fsi— public signatures with XML doc; placed after their single-source counterpartssrc/FSharp.Control.TaskSeq.Test/TaskSeq.Exists2Forall2Fold2.Tests.fs— 206 new tests: null checks, empty sequences (both/first/second empty), truncation at shorter sequence, type mixing, side-effect sequences, early-exit behavioursrc/FSharp.Control.TaskSeq.Test/FSharp.Control.TaskSeq.Test.fsproj— new test file referencerelease-notes.txt— entry under v0.6.0README.md— markexists2,fold2/fold2Async,forall2/forall2Asyncas ✅ in the table; update checklistAI 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 . --checkpasses