Conversation
- TaskSeq.replicate: creates a task sequence containing a value n times - TaskSeq.zip3: combines three task sequences into triples, truncating to shortest - 13 tests for replicate (empty, negative count, correctness, reusability) - 47 tests for zip3 (null checks, empty, truncation, mixed types, side effects) - Update README.md: mark replicate and zip3 as implemented Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 tasks
dsyme
approved these changes
Mar 8, 2026
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 two straightforward combinators that mirror their
Seq/List/Arraycounterparts:TaskSeq.replicatentimesTaskSeq.zip3Both functions were listed in the README as "not yet implemented" (no note-1 restriction — they don't require pre-materialisation).
Implementation details
replicate: validatedcount ≥ 0, implemented as a simpletaskSeq { for _ in 1..count -> value }. RaisesArgumentExceptionfor negative counts (consistent withinit).zip3: follows the same pattern as the existingzip— uses three async enumerators, advances all three in lockstep, stops when any is exhausted.Test Status
✅ Build:
dotnet build src/FSharp.Control.TaskSeq.sln -c Release— succeeded, 0 warnings✅ Tests:
dotnet test— 3910 passed, 2 skipped, 0 failed✅ Format:
dotnet fantomas . --check— passedNew tests (60 total)
TaskSeq.Replicate.Tests.fs— 13 tests: empty (count=0), negative-count error, correct count/value, large count, null value, reuse of task seq, mutable value captureTaskSeq.Zip.Tests.fs— 47 tests added forzip3: null checks, empty sequences (all three positions), truncation to shortest, mixed types, side effectsChanges
TaskSeqInternal.fs—replicate(aftersingleton),zip3(afterzip)TaskSeq.fsi— XML-doc signatures for bothTaskSeq.fs— thin delegating membersTaskSeq.Replicate.Tests.fs— new test fileTaskSeq.Zip.Tests.fs— extended withzip3testsFSharp.Control.TaskSeq.Test.fsproj— added new test fileREADME.md— markedreplicateandzip3as ✅ implemented