Skip to content

[Repo Assist] feat: add TaskSeq.replicate and TaskSeq.zip3 (60 tests)#308

Merged
dsyme merged 3 commits intomainfrom
repo-assist/feat-replicate-zip3-2026-03-6cd05ed182dd3f33
Mar 8, 2026
Merged

[Repo Assist] feat: add TaskSeq.replicate and TaskSeq.zip3 (60 tests)#308
dsyme merged 3 commits intomainfrom
repo-assist/feat-replicate-zip3-2026-03-6cd05ed182dd3f33

Conversation

@github-actions
Copy link
Contributor

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

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

Summary

Adds two straightforward combinators that mirror their Seq/List/Array counterparts:

Function Description
TaskSeq.replicate Creates a task sequence by repeating a value n times
TaskSeq.zip3 Combines three task sequences into triples, truncating to the shortest

Both functions were listed in the README as "not yet implemented" (no note-1 restriction — they don't require pre-materialisation).

Implementation details

  • replicate: validated count ≥ 0, implemented as a simple taskSeq { for _ in 1..count -> value }. Raises ArgumentException for negative counts (consistent with init).
  • zip3: follows the same pattern as the existing zip — 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 test3910 passed, 2 skipped, 0 failed
Format: dotnet fantomas . --check — passed

New 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 capture
  • TaskSeq.Zip.Tests.fs — 47 tests added for zip3: null checks, empty sequences (all three positions), truncation to shortest, mixed types, side effects

Changes

  • TaskSeqInternal.fsreplicate (after singleton), zip3 (after zip)
  • TaskSeq.fsi — XML-doc signatures for both
  • TaskSeq.fs — thin delegating members
  • TaskSeq.Replicate.Tests.fs — new test file
  • TaskSeq.Zip.Tests.fs — extended with zip3 tests
  • FSharp.Control.TaskSeq.Test.fsproj — added new test file
  • README.md — marked replicate and zip3 as ✅ implemented

Generated by Repo Assist ·

To install this agentic workflow, run

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

- 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>
@dsyme dsyme marked this pull request as ready for review March 8, 2026 00:27
@dsyme dsyme merged commit f4c6fb0 into main Mar 8, 2026
4 checks passed
@dsyme dsyme deleted the repo-assist/feat-replicate-zip3-2026-03-6cd05ed182dd3f33 branch March 8, 2026 02:04
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.

1 participant