Repository navigation
Description
🤖 This PR was created by the repository's automated AI maintenance assistant.
Closes #165
Root cause
AsyncSeq.mergeAll previously required a list argument. Since F# lists, arrays, and other collections all implement seq, accepting seq(AsyncSeq<'T)> makes the function more ergonomic — in particular, users can pass the result of Async.Parallel (which returns an array) without an explicit conversion.
Change
.fsi: Changed parameter type fromAsyncSeq<'T> listtoseq(AsyncSeq<'T)>.fs: Changed parameter type to match; addedlet ss = List.ofSeq ssto materialise the sequence before use (the implementation needs.Lengthand indexed access)
Backward compatibility
list implements seq, so all existing call sites continue to compile without changes.
Test Status
- Debug build passes (
dotnet build -c Debug) - Release build passes (
dotnet build -c Release) - Debug tests pass (
dotnet test -c Debug) — 182 passed, 0 failed - Release tests pass (
dotnet test -c Release) — 182 passed, 0 failed
Generated by Auto Maintainer Assistant
Note
This was originally intended as a pull request, but the git push operation failed.
Workflow Run: View run details and download patch artifact
The patch file is available in the agent-artifacts artifact in the workflow run linked above.
To apply the patch locally:
# Download the artifact from the workflow run https://github.com/fsprojects/FSharp.Control.AsyncSeq/actions/runs/22231625810
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 22231625810 -n agent-artifacts
# The patch file will be at agent-artifacts/tmp/gh-aw/aw.patch after download
# Apply the patch
git am agent-artifacts/tmp/gh-aw/aw.patchShow patch preview (50 of 50 lines)
From 65a9fec49da5bd075e5e6560305e3bfef0691a33 Mon Sep 17 00:00:00 2001
From: "github-actions[bot]" <github-actions[bot]@users.noreply.github.com>
Date: Fri, 20 Feb 2026 16:20:58 +0000
Subject: [PATCH] feat: change AsyncSeq.mergeAll to accept seq instead of list
This makes mergeAll more flexible by accepting any sequence type
(list, array, seq, etc.), which is backward compatible since list
implements seq.
Closes #165
Co-authored-by: Copilot <[email protected]>
---
src/FSharp.Control.AsyncSeq/AsyncSeq.fs | 3 ++-
src/FSharp.Control.AsyncSeq/AsyncSeq.fsi | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/FSharp.Control.AsyncSeq/AsyncSeq.fs b/src/FSharp.Control.AsyncSeq/AsyncSeq.fs
index f749ea7..bfcbb83 100644
--- a/src/FSharp.Control.AsyncSeq/AsyncSeq.fs
+++ b/src/FSharp.Control.AsyncSeq/AsyncSeq.fs
@@ -1700,8 +1700,9 @@ member x.Dispose() =
/// Merges all specified async sequences into an async sequence non-deterministically.
// By moving the last emitted task to the end of the array, this algorithm achieves max-min fairness when merging AsyncSeqs
- let mergeAll (ss:AsyncSeq<'T> list) : AsyncSeq<'T> =
+ let mergeAll (ss:seq<AsyncSeq<'T>>) : AsyncSeq<'T> =
asyncSeq {
+ let ss = List.ofSeq ss
let n = ss.Length
let moveToEnd i (a: 'a[]) =
diff --git a/src/FSharp.Control.AsyncSeq/AsyncSeq.fsi b/src/FSharp.Control.AsyncSeq/AsyncSeq.fsi
index 15c1bf5..e0ad0c1 100644
--- a/src/FSharp.Control.AsyncSeq/AsyncSeq.fsi
+++ b/src/FSharp.Control.AsyncSeq/AsyncSeq.fsi
@@ -502,7 +502,8 @@ inherit IDisposable
/// Merges all specified async sequences into an async sequence non-deterministically.
/// The resulting async sequence produces elements when any argument sequence produces an element.
- val mergeAll : sources:AsyncSeq<'T> list -> AsyncSeq<'T>
+ /// Accepts any sequence type (list, array, seq, etc.).
+ val mergeAll : sources:seq<AsyncSeq<'T>> -> AsyncSeq<'T>
#end
... (truncated)
Activity
dsyme commentedon Feb 20, 2026
Closing as the PR was not successfully created and I'd like this to be retried when we update GH AW tooling