[Repo Assist] Add AsyncSeq.insertManyAt, removeManyAt, splitInto#321
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
[Repo Assist] Add AsyncSeq.insertManyAt, removeManyAt, splitInto#321github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
API parity with F# 6 collection modules (Seq/List/Array): - insertManyAt: insert multiple values before the element at index - removeManyAt: remove a range of elements starting at index - splitInto: split sequence into at most N equal-sized chunks 11 new tests covering normal cases, edge cases, and argument validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7 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 PR was created by Repo Assist, an automated AI assistant.
Summary
Adds three API functions for parity with F# 6 collection modules (
Seq,List,Array):AsyncSeq.insertManyAtSeq.insertManyAt/List.insertManyAtAsyncSeq.removeManyAtcountelements starting at the specified indexSeq.removeManyAt/List.removeManyAtAsyncSeq.splitIntocountchunks of as-equal-as-possible sizeSeq.splitInto/Array.splitIntoMotivation
The existing API already has
insertAt,removeAt, andupdateAt(added in 4.11/4.15). The natural companions —insertManyAt,removeManyAt— were missing. Similarly,chunkBySizeexists butsplitInto(which divides into N roughly-equal chunks) had no AsyncSeq equivalent.Implementation Details
insertManyAt: lazyasyncSeqthat yields the values sequence at the insertion point;yield! valueshandles anyseq<'T>efficiently.removeManyAt: lazyasyncSeqthat skips elements in the[index, index+count)range; validates bounds after enumeration (consistent withremoveAt/insertAtstyle).splitInto: materialises to an array (same approach assort/rev/partition), then uses the standard F# formula: firsttotal mod countchunks get(total / count) + 1elements, the rest gettotal / count. UsesOperators.minto avoid shadowing by the module-levelAsyncSeq.min..fsisignature file updated with XML doc comments.RELEASE_NOTES.mdupdated under the4.16.0entry.Test Status
✅ Build: 0 errors, pre-existing warnings only
✅ Tests: 442/442 passed (11 new tests added covering normal, edge, and error cases for all three functions)