Skip to content

Commit 0087ccc

Browse files
authored
Merge pull request #221 from fsprojects/co-maintainer/mergeall-accept-seq-9921c501a078d92a
[Auto Maintainer Assistant] Allow AsyncSeq.mergeAll to accept seq instead of list
2 parents bd2b652 + 792a354 commit 0087ccc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/FSharp.Control.AsyncSeq/AsyncSeq.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,8 +1700,9 @@ module AsyncSeq =
17001700

17011701
/// Merges all specified async sequences into an async sequence non-deterministically.
17021702
// By moving the last emitted task to the end of the array, this algorithm achieves max-min fairness when merging AsyncSeqs
1703-
let mergeAll (ss:AsyncSeq<'T> list) : AsyncSeq<'T> =
1703+
let mergeAll (ss:seq<AsyncSeq<'T>>) : AsyncSeq<'T> =
17041704
asyncSeq {
1705+
let ss = Seq.toArray ss
17051706
let n = ss.Length
17061707

17071708
let moveToEnd i (a: 'a[]) =

src/FSharp.Control.AsyncSeq/AsyncSeq.fsi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ module AsyncSeq =
502502

503503
/// Merges all specified async sequences into an async sequence non-deterministically.
504504
/// The resulting async sequence produces elements when any argument sequence produces an element.
505-
val mergeAll : sources:AsyncSeq<'T> list -> AsyncSeq<'T>
505+
val mergeAll : sources:seq<AsyncSeq<'T>> -> AsyncSeq<'T>
506506
#endif
507507

508508
/// Returns an async sequence which contains no contiguous duplicate elements based on the specified comparison function.

0 commit comments

Comments
 (0)