Skip to content

[Repo Assist] Add AsyncSeq.insertManyAt, removeManyAt, splitInto#321

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/improve-insert-remove-splitinto-20260427-c538b1cd17009ced
Draft

[Repo Assist] Add AsyncSeq.insertManyAt, removeManyAt, splitInto#321
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/improve-insert-remove-splitinto-20260427-c538b1cd17009ced

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 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):

Function Description Mirrors
AsyncSeq.insertManyAt Inserts multiple values before the element at the specified index Seq.insertManyAt / List.insertManyAt
AsyncSeq.removeManyAt Removes count elements starting at the specified index Seq.removeManyAt / List.removeManyAt
AsyncSeq.splitInto Splits into at most count chunks of as-equal-as-possible size Seq.splitInto / Array.splitInto

Motivation

The existing API already has insertAt, removeAt, and updateAt (added in 4.11/4.15). The natural companions — insertManyAt, removeManyAt — were missing. Similarly, chunkBySize exists but splitInto (which divides into N roughly-equal chunks) had no AsyncSeq equivalent.

Implementation Details

  • insertManyAt: lazy asyncSeq that yields the values sequence at the insertion point; yield! values handles any seq<'T> efficiently.
  • removeManyAt: lazy asyncSeq that skips elements in the [index, index+count) range; validates bounds after enumeration (consistent with removeAt/insertAt style).
  • splitInto: materialises to an array (same approach as sort/rev/partition), then uses the standard F# formula: first total mod count chunks get (total / count) + 1 elements, the rest get total / count. Uses Operators.min to avoid shadowing by the module-level AsyncSeq.min.
  • .fsi signature file updated with XML doc comments.
  • RELEASE_NOTES.md updated under the 4.16.0 entry.

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)

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

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

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>
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.

0 participants