Conversation
Task 10 — Add TaskSeq.pairwise (ref #289): - Implement Internal.pairwise in TaskSeqInternal.fs using the same ValueNone/ValueSome pattern as distinctUntilChanged - Expose as TaskSeq.pairwise static member in TaskSeq.fs + TaskSeq.fsi - Mirrors FSharp.Control.AsyncSeq.pairwise semantics: yields each element paired with its successor; empty for <2 elements Task 9 — Expand distinctUntilChanged tests: - Add Functionality tests: singleton, all-same, all-distinct, alternating - Add Immutable module with TestImmTaskSeq variants - Add SideEffects module: verify element consumption count, correct output - Add TestSideEffectTaskSeq variant test - New test file TaskSeq.Pairwise.Tests.fs: empty/singleton/two-element/ consecutive-pairs/length/boundary/side-effects/variant coverage Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
/repo-assist Update the release notes please |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
|
Commit pushed:
|
This was referenced Mar 7, 2026
Added a section for release notes in AGENTS.md.
Contributor
Author
|
Commit pushed:
|
dsyme
approved these changes
Mar 7, 2026
github-actions bot
pushed a commit
that referenced
this pull request
Mar 7, 2026
…289) - TaskSeq.chunkBySize: divides a task sequence into non-overlapping chunks of at most chunkSize elements. Uses a fixed-size array buffer (vs. ResizeArray) to avoid intermediate allocations and resizing. - TaskSeq.windowed: returns overlapping sliding windows of a fixed size. Uses a ring buffer internally so that only a single allocation (per window) is needed; no redundant element copies on each step. Both functions validate their size argument eagerly (before enumeration starts), raise ArgumentException for non-positive sizes, and are fully documented in the .fsi signature file. Also: - Update README.md to mark chunkBySize, windowed, pairwise, scan/scanAsync, reduce/reduceAsync, and unfold/unfoldAsync as implemented (these were merged in PRs #293, #296, #299, #300 respectively). - Update release-notes.txt for 0.5.0. - 171 new tests across TaskSeq.ChunkBySize.Tests.fs and TaskSeq.Windowed.Tests.fs. All 4021 existing tests continue to pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Two improvements: a new
TaskSeq.pairwisefunction (addressing #289), and substantially expanded tests forTaskSeq.distinctUntilChanged.Task 10 — Forward:
TaskSeq.pairwise(ref #289)Implements
pairwiseto align withFSharp.Control.AsyncSeq.pairwise, as requested in #289. This is the first of what should be multiple incremental PRs toward full AsyncSeq alignment.Semantics: Returns a task sequence of consecutive overlapping pairs
(a₀,a₁), (a₁,a₂), …. Returns empty if the source has fewer than two elements. MirrorsSeq.pairwise.Implementation (
TaskSeqInternal.fs): uses the sameValueNone/ValueSomestate pattern asdistinctUntilChanged— no heap allocation beyond the singleValueOptionslot:Changes:
TaskSeqInternal.fs(impl),TaskSeq.fs(static member),TaskSeq.fsi(signature + XML doc).Task 9 — Testing: expand
distinctUntilChanged+ newpairwisetestsTaskSeq.DistinctUntilChanged.Tests.fs— from 39 → ~110 linesThe file previously had only 2 tests (one null, one functionality). Added:
Functionality module:
[A;A;B;B;A;A]→[A;B;A]TestImmTaskSeqvariant test (1..10 all unique, all preserved)SideEffects module:
[1;1;2;2;3])TestSideEffectTaskSeqvariant testTaskSeq.Pairwise.Tests.fs— new fileFull coverage following the established module structure:
EmptySeq: null arg, empty variants, singleton → emptyImmutable: two-element, 1..5 sequence, length formula, shared elements ((A,B),(B,C)— right of pair i = left of pair i+1),TestImmTaskSeqvariantsSideEffects: exact consumption count,TestSideEffectTaskSeqvariantsTest Status