-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathAsyncSeq.fsi
More file actions
849 lines (649 loc) · 48.6 KB
/
AsyncSeq.fsi
File metadata and controls
849 lines (649 loc) · 48.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
namespace FSharp.Control
open System
#if FABLE_COMPILER
/// Internal pull-based enumerator used by AsyncSeq<'T> in Fable builds.
[<NoEquality; NoComparison>]
type IAsyncSeqEnumerator<'T> =
abstract MoveNext : unit -> Async<'T option>
inherit IDisposable
/// An asynchronous sequence.
[<NoEquality; NoComparison>]
type AsyncSeq<'T> =
abstract GetEnumerator : unit -> IAsyncSeqEnumerator<'T>
#else
/// An asynchronous sequence; equivalent to System.Collections.Generic.IAsyncEnumerable<'T>.
/// Use the asyncSeq { ... } computation expression to create values, and the AsyncSeq module
/// for combinators.
type AsyncSeq<'T> = System.Collections.Generic.IAsyncEnumerable<'T>
#endif
[<RequireQualifiedAccess>]
module AsyncSeq =
/// Creates an empty asynchronous sequence that immediately ends.
[<GeneralizableValueAttribute>]
val empty<'T> : AsyncSeq<'T>
/// Creates an asynchronous sequence that generates a single element and then ends.
val singleton : v:'T -> AsyncSeq<'T>
/// Generates a finite async sequence using the specified asynchronous initialization function.
val initAsync : count: int64 -> mapping:(int64 -> Async<'T>) -> AsyncSeq<'T>
/// Generates a finite async sequence using the specified initialization function.
val init : count: int64 -> mapping:(int64 -> 'T) -> AsyncSeq<'T>
/// Generates an infinite async sequence using the specified asynchronous initialization function.
val initInfiniteAsync : mapping:(int64 -> Async<'T>) -> AsyncSeq<'T>
/// Generates an infinite async sequence using the specified initialization function.
val initInfinite : mapping:(int64 -> 'T) -> AsyncSeq<'T>
/// Generates an async sequence using the specified asynchronous generator function.
val unfoldAsync : generator:('State -> Async<('T * 'State) option>) -> state:'State -> AsyncSeq<'T>
/// Generates an async sequence using the specified generator function.
val unfold : generator:('State -> ('T * 'State) option) -> state:'State -> AsyncSeq<'T>
/// Creates an async sequence which repeats the specified value the indicated number of times.
val replicate : count: int -> v:'T -> AsyncSeq<'T>
/// Creates an infinite async sequence which repeats the specified value.
val replicateInfinite : v:'T -> AsyncSeq<'T>
/// Creates an infinite async sequence which repeatedly evaluates and emits the specified async value.
val replicateInfiniteAsync : v:Async<'T> -> AsyncSeq<'T>
/// Creates an async sequence given by evaluating the specified async computation until it returns None.
val replicateUntilNoneAsync : Async<'T option> -> AsyncSeq<'T>
/// Returns an async sequence which emits an element on a specified period.
val intervalMs : periodMs:int -> AsyncSeq<DateTime>
/// Yields all elements of the first asynchronous sequence and then
/// all elements of the second asynchronous sequence.
val append : seq1:AsyncSeq<'T> -> seq2:AsyncSeq<'T> -> AsyncSeq<'T>
/// Computation builder that allows creating of asynchronous
/// sequences using the 'asyncSeq { ... }' syntax
type AsyncSeqBuilder =
/// Internal use only
new : unit -> AsyncSeqBuilder
/// Implements binding for the asyncSeq computation builder.
member Bind : source:Async<'T> * body:('T -> AsyncSeq<'U>) -> AsyncSeq<'U>
/// Implements sequential composition for the asyncSeq computation builder.
member Combine : seq1:AsyncSeq<'T> * seq2:AsyncSeq<'T> -> AsyncSeq<'T>
/// Implements delay for the asyncSeq computation builder.
member Delay : f:(unit -> AsyncSeq<'T>) -> AsyncSeq<'T>
/// For loop that iterates over a synchronous sequence (and generates
/// all elements generated by the asynchronous body)
member For : source:seq<'T> * action:('T -> AsyncSeq<'TResult>) -> AsyncSeq<'TResult>
/// Implements "for" loops for the asyncSeq computation builder.
///
/// Asynchronous for loop - for all elements from the input sequence,
/// generate all elements produced by the body (asynchronously). See
/// also the AsyncSeq.collect function.
member For : source:AsyncSeq<'T> * action:('T -> AsyncSeq<'TResult>) -> AsyncSeq<'TResult>
/// Implements "try-finally" for the asyncSeq computation builder.
member TryFinally : body:AsyncSeq<'T> * compensation:(unit -> unit) -> AsyncSeq<'T>
/// Implements "try-with" for the asyncSeq computation builder.
member TryWith : body:AsyncSeq<'T> * handler:(exn -> AsyncSeq<'T>) -> AsyncSeq<'T>
/// Implements "use" for the asyncSeq computation builder.
member Using : resource:'T * binder:('T -> AsyncSeq<'U>) -> AsyncSeq<'U> when 'T :> System.IDisposable
/// Implements "while" for the asyncSeq computation builder.
member While : guard:(unit -> bool) * body:AsyncSeq<'T> -> AsyncSeq<'T>
/// Implements "yield" for the asyncSeq computation builder.
member Yield : value:'T -> AsyncSeq<'T>
/// Implements "yield!" for the asyncSeq computation builder.
member YieldFrom : source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Implements "yield!" for a synchronous sequence in the asyncSeq computation builder.
member YieldFrom : source:seq<'T> -> AsyncSeq<'T>
/// Implements empty for the asyncSeq computation builder.
member Zero : unit -> AsyncSeq<'T>
/// Creates an asynchronous sequence that iterates over the given input sequence.
/// For every input element, it calls the the specified function and iterates
/// over all elements generated by that asynchronous sequence.
/// This is the 'bind' operation of the computation expression (exposed using
/// the 'for' keyword in asyncSeq computation).
val collect : mapping:('T -> AsyncSeq<'TResult>) -> source:AsyncSeq<'T> -> AsyncSeq<'TResult>
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence.
///
/// The specified function is asynchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val mapAsync : mapping:('T -> Async<'TResult>) -> source:AsyncSeq<'T> -> AsyncSeq<'TResult>
/// Asynchronously iterates over the input sequence and generates 'x' for
/// every input element for which the specified asynchronous function
/// returned 'Some(x)'
///
/// The specified function is asynchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val chooseAsync : mapping:('T -> Async<'R option>) -> source:AsyncSeq<'T> -> AsyncSeq<'R>
/// Builds a new asynchronous sequence whose elements are those from the
/// input sequence for which the specified function returned true.
///
/// The specified function is asynchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val filterAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Asynchronously returns the last element that was generated by the
/// given asynchronous sequence (or the specified default value).
val lastOrDefault : ``default``:'T -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the last element that was generated by the
/// given asynchronous sequence (or None if the sequence is empty).
val tryLast : source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously returns the last element of the asynchronous sequence.
/// Raises InvalidOperationException if the sequence is empty, mirroring Seq.last.
val last : source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the element at the specified index in the asynchronous sequence.
/// Raises ArgumentException if the index is out of bounds, mirroring Seq.item.
val item : index:int -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the element at the specified index in the asynchronous sequence,
/// or None if the index is out of bounds, mirroring Seq.tryItem.
val tryItem : index:int -> source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously returns the first element that was generated by the
/// given asynchronous sequence (or the specified default value).
val firstOrDefault : ``default``:'T -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the first element that was generated by the
/// given asynchronous sequence (or None if the sequence is empty).
val tryFirst : source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously returns the first element of the asynchronous sequence.
/// Raises InvalidOperationException if the sequence is empty.
val head : source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the first element of the asynchronous sequence as an option,
/// or None if the sequence is empty. Mirrors Seq.tryHead.
val tryHead : source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously returns true if the asynchronous sequence contains no elements, false otherwise.
/// Short-circuits after the first element. Mirrors Seq.isEmpty.
val isEmpty : source:AsyncSeq<'T> -> Async<bool>
/// Asynchronously returns the only element of the asynchronous sequence.
/// Raises InvalidOperationException if the sequence is empty or contains more than one element.
val exactlyOne : source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously returns the only element of the asynchronous sequence, or None if the
/// sequence is empty or contains more than one element.
val tryExactlyOne : source:AsyncSeq<'T> -> Async<'T option>
/// Aggregates the elements of the input asynchronous sequence using the
/// specified 'aggregation' function. The result is an asynchronous
/// sequence of intermediate aggregation result.
///
/// The aggregation function is asynchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val scanAsync : folder:('State -> 'T -> Async<'State>) -> state:'State -> source:AsyncSeq<'T> -> AsyncSeq<'State>
/// Iterates over the input sequence and calls the specified asynchronous function for
/// every value. The input sequence will be asked for the next element after
/// the processing of an element completes.
val iterAsync : action:('T -> Async<unit>) -> source:AsyncSeq<'T> -> Async<unit>
/// Iterates over the input sequence and calls the specified asynchronous function for
/// every value, passing along the index of that element.
/// The input sequence will be asked for the next element after the processing of an element completes.
val iteriAsync : action:(int -> 'T -> Async<unit>) -> source:AsyncSeq<'T> -> Async<unit>
/// Iterates over the input sequence and calls the specified function for
/// every value, passing along the index of that element.
val iteri : action:(int -> 'T -> unit) -> source:AsyncSeq<'T> -> Async<unit>
#if !FABLE_COMPILER
/// Iterates over the input sequence and calls the specified asynchronous function for
/// every value. Each action computation is started but not awaited before consuming
/// the next item from the sequence, thereby iterating in parallel.
val iterAsyncParallel : action:('T -> Async<unit>) -> source:AsyncSeq<'T> -> Async<unit>
/// Iterates over the input sequence and calls the specified asynchronous function for
/// every value. Each action computation is started but not awaited before consuming
/// the next item from the sequence, thereby iterating in parallel with a specified degree of parallelism.
val iterAsyncParallelThrottled : parallelism:int -> action:('T -> Async<unit>) -> source:AsyncSeq<'T> -> Async<unit>
#endif
/// Returns an asynchronous sequence that returns pairs containing an element
/// from the input sequence and its predecessor. Empty sequence is returned for
/// singleton input sequence.
val pairwise : source:AsyncSeq<'T> -> AsyncSeq<'T * 'T>
/// Returns an asynchronous sequence that yields sliding windows of the given size
/// over the source sequence, each yielded as an array. The first window is emitted
/// once <c>windowSize</c> elements have been consumed; subsequent windows slide one
/// element at a time. The sequence is empty when the source has fewer than
/// <c>windowSize</c> elements. Raises <c>System.ArgumentException</c> if
/// <c>windowSize</c> is less than 1.
val windowed : windowSize:int -> source:AsyncSeq<'T> -> AsyncSeq<'T []>
/// Asynchronously aggregate the elements of the input asynchronous sequence using the
/// specified asynchronous 'aggregation' function.
val foldAsync : folder:('State -> 'T -> Async<'State>) -> state:'State -> source:AsyncSeq<'T> -> Async<'State>
/// Asynchronously aggregate the elements of the input asynchronous sequence using the
/// specified 'aggregation' function.
val fold : folder:('State -> 'T -> 'State) -> state:'State -> source:AsyncSeq<'T> -> Async<'State>
/// Asynchronously reduce the elements of the input asynchronous sequence using the
/// specified asynchronous 'reduction' function. Raises InvalidOperationException if the sequence is empty.
val reduceAsync : reduction:('T -> 'T -> Async<'T>) -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously reduce the elements of the input asynchronous sequence using the
/// specified 'reduction' function. Raises InvalidOperationException if the sequence is empty.
val reduce : reduction:('T -> 'T -> 'T) -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously sum the elements of the input asynchronous sequence using the specified function.
val inline sum : source:AsyncSeq< ^T > -> Async< ^T>
when ^T : (static member ( + ) : ^T * ^T -> ^T)
and ^T : (static member Zero : ^T)
/// Asynchronously find the element with the minimum projected value. Raises InvalidOperationException if the sequence is empty.
val minByAsync : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> Async<'T> when 'Key : comparison
/// Asynchronously find the element with the minimum projected value. Raises InvalidOperationException if the sequence is empty.
val minBy : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> Async<'T> when 'Key : comparison
/// Asynchronously find the element with the maximum projected value. Raises InvalidOperationException if the sequence is empty.
val maxByAsync : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> Async<'T> when 'Key : comparison
/// Asynchronously find the element with the maximum projected value. Raises InvalidOperationException if the sequence is empty.
val maxBy : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> Async<'T> when 'Key : comparison
/// Asynchronously find the minimum element. Raises InvalidOperationException if the sequence is empty.
val min : source:AsyncSeq<'T> -> Async<'T> when 'T : comparison
/// Asynchronously find the maximum element. Raises InvalidOperationException if the sequence is empty.
val max : source:AsyncSeq<'T> -> Async<'T> when 'T : comparison
/// Asynchronously sum the mapped elements of an asynchronous sequence using a synchronous projection.
val inline sumBy : projection:('T -> ^U) -> source:AsyncSeq<'T> -> Async< ^U>
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member Zero : ^U)
/// Asynchronously sum the mapped elements of an asynchronous sequence using an asynchronous projection.
val inline sumByAsync : projection:('T -> Async< ^U>) -> source:AsyncSeq<'T> -> Async< ^U>
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member Zero : ^U)
/// Asynchronously compute the average of the elements of the input asynchronous sequence.
/// Raises InvalidArgumentException if the sequence is empty.
val inline average : source:AsyncSeq< ^T> -> Async< ^T>
when ^T : (static member ( + ) : ^T * ^T -> ^T)
and ^T : (static member DivideByInt : ^T * int -> ^T)
and ^T : (static member Zero : ^T)
/// Asynchronously compute the average of the mapped elements of an asynchronous sequence using a synchronous projection.
/// Raises InvalidArgumentException if the sequence is empty.
val inline averageBy : projection:('T -> ^U) -> source:AsyncSeq<'T> -> Async< ^U>
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member DivideByInt : ^U * int -> ^U)
and ^U : (static member Zero : ^U)
/// Asynchronously compute the average of the mapped elements of an asynchronous sequence using an asynchronous projection.
/// Raises InvalidArgumentException if the sequence is empty.
val inline averageByAsync : projection:('T -> Async< ^U>) -> source:AsyncSeq<'T> -> Async< ^U>
when ^U : (static member ( + ) : ^U * ^U -> ^U)
and ^U : (static member DivideByInt : ^U * int -> ^U)
and ^U : (static member Zero : ^U)
/// Asynchronously count the elements of the input asynchronous sequence grouped by the result of the given asynchronous key projection.
/// Returns an array of (key, count) pairs.
val countByAsync : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> Async<('Key * int) array> when 'Key : equality
/// Asynchronously count the elements of the input asynchronous sequence grouped by the result of the given key projection.
/// Returns an array of (key, count) pairs.
val countBy : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> Async<('Key * int) array> when 'Key : equality
/// Asynchronously determine if the sequence contains the given value
val contains : value:'T -> source:AsyncSeq<'T> -> Async<bool> when 'T : equality
/// Asynchronously pick a value from a sequence based on the specified chooser function.
val tryPickAsync : chooser:('T -> Async<'TResult option>) -> source:AsyncSeq<'T> -> Async<'TResult option>
/// Asynchronously pick a value from a sequence based on the specified chooser function.
val tryPick : chooser:('T -> 'TResult option) -> source:AsyncSeq<'T> -> Async<'TResult option>
/// Asynchronously pick a value from a sequence based on the specified chooser function.
/// Raises KeyNotFoundException if the chooser function can't find a matching key.
val pickAsync : chooser:('T -> Async<'TResult option>) -> source:AsyncSeq<'T> -> Async<'TResult>
/// Asynchronously pick a value from a sequence based on the specified chooser function.
/// Raises KeyNotFoundException if the chooser function can't find a matching key.
val pick : chooser:('T -> 'TResult option) -> source:AsyncSeq<'T> -> Async<'TResult>
/// Asynchronously find the first value in a sequence for which the predicate returns true
val tryFind : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously find the first value in a sequence for which the async predicate returns true
val tryFindAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<'T option>
/// Asynchronously find the first value in a sequence for which the predicate returns true.
/// Raises KeyNotFoundException if no matching element is found.
val find : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously find the first value in a sequence for which the async predicate returns true.
/// Raises KeyNotFoundException if no matching element is found.
val findAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<'T>
/// Asynchronously find the index of the first value in a sequence for which the predicate returns true.
/// Returns None if no matching element is found.
val tryFindIndex : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<int option>
/// Asynchronously find the index of the first value in a sequence for which the async predicate returns true.
/// Returns None if no matching element is found.
val tryFindIndexAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<int option>
/// Asynchronously find the index of the first value in a sequence for which the predicate returns true.
/// Raises KeyNotFoundException if no matching element is found.
val findIndex : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<int>
/// Asynchronously find the index of the first value in a sequence for which the async predicate returns true.
/// Raises KeyNotFoundException if no matching element is found.
val findIndexAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<int>
/// Asynchronously determine if there is a value in the sequence for which the predicate returns true
val exists : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<bool>
/// Asynchronously determine if there is a value in the sequence for which the async predicate returns true
val existsAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<bool>
/// Asynchronously determine if the predicate returns true for all values in the sequence
val forall : predicate:('T -> bool) -> source:AsyncSeq<'T> -> Async<bool>
/// Asynchronously determine if the async predicate returns true for all values in the sequence
val forallAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> Async<bool>
/// Return an asynchronous sequence which, when iterated, includes an integer indicating the index of each element in the sequence.
val indexed : source:AsyncSeq<'T> -> AsyncSeq<int64 * 'T>
/// Asynchronously determine the number of elements in the sequence
val length : source:AsyncSeq<'T> -> Async<int64>
/// Same as AsyncSeq.scanAsync, but the specified function is synchronous.
val scan : folder:('State -> 'T -> 'State) -> state:'State -> source:AsyncSeq<'T> -> AsyncSeq<'State>
/// Same as AsyncSeq.mapAsync, but the specified function is synchronous.
val map : folder:('T -> 'U) -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Iterates over the input sequence and calls the specified function for
/// every value.
val iter : action:('T -> unit) -> source:AsyncSeq<'T> -> Async<unit>
/// Asynchronously iterates over the input sequence and generates 'x' for
/// every input element for which the specified function
/// returned 'Some(x)'
val choose : chooser:('T -> 'U option) -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Same as AsyncSeq.filterAsync, but the specified predicate is synchronous
/// and processes the input element immediately.
val filter : predicate:('T -> bool) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns a new asynchronous sequence containing only elements that are not present
/// in the given excluded collection. Uses a HashSet for O(1) lookup. Mirrors Seq.except.
val except : excluded:seq<'T> -> source:AsyncSeq<'T> -> AsyncSeq<'T> when 'T : equality
/// Returns a new asynchronous sequence with the element at the specified index removed.
/// Raises ArgumentException if index is negative. Mirrors Seq.removeAt.
val removeAt : index:int -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns a new asynchronous sequence with the element at the specified index replaced by the given value.
/// Raises ArgumentException if index is negative. Mirrors Seq.updateAt.
val updateAt : index:int -> value:'T -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns a new asynchronous sequence with the given value inserted before the element at the specified index.
/// An index equal to the length of the sequence appends the value at the end.
/// Raises ArgumentException if index is negative or greater than the sequence length. Mirrors Seq.insertAt.
val insertAt : index:int -> value:'T -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Creates an asynchronous sequence that lazily takes element from an
/// input synchronous sequence and returns them one-by-one.
val ofSeq : source:seq<'T> -> AsyncSeq<'T>
/// Creates an asynchronous sequence that lazily takes element from an
/// input synchronous sequence of asynchronous computation and returns them one-by-one.
val ofSeqAsync : seq<Async<'T>> -> AsyncSeq<'T>
/// Converts observable to an asynchronous sequence. Values that are produced
/// by the observable while the asynchronous sequence is blocked are stored to
/// an unbounded buffer and are returned as next elements of the async sequence.
val ofObservableBuffered : source:System.IObservable<'T> -> AsyncSeq<'T>
[<System.Obsolete("Please use AsyncSeq.ofObservableBuffered. The original AsyncSeq.ofObservable doesn't guarantee that the asynchronous sequence will return all values produced by the observable",true) >]
val ofObservable : source:System.IObservable<'T> -> AsyncSeq<'T>
/// Converts asynchronous sequence to an IObservable<_>. When the client subscribes
/// to the observable, a new copy of asynchronous sequence is started and is
/// sequentially iterated over (at the maximal possible speed). Disposing of the
/// observer cancels the iteration over asynchronous sequence.
val toObservable : source:AsyncSeq<'T> -> System.IObservable<'T>
#if !FABLE_COMPILER
/// Converts asynchronous sequence to a synchronous blocking sequence.
/// The elements of the asynchronous sequence are consumed lazily.
val toBlockingSeq : source:AsyncSeq<'T> -> seq<'T>
/// Create a new asynchronous sequence that caches all elements of the
/// sequence specified as the input. When accessing the resulting sequence
/// multiple times, the input will still be evaluated only once
val cache : source:AsyncSeq<'T> -> AsyncSeq<'T>
#endif
/// Threads a state through the mapping over an async sequence using an async function.
val threadStateAsync : folder:('State -> 'T -> Async<'U * 'State>) -> st:'State -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Combines two asynchronous sequences using the specified function.
/// The resulting sequence stops when either of the argument sequences stop.
val zipWithAsync : mapping:('T1 -> 'T2 -> Async<'U>) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<'U>
/// Combines two asynchronous sequences using the specified function.
/// The values from sequences are retrieved in parallel.
/// The resulting sequence stops when either of the argument sequences stop.
val zipWithAsyncParallel : mapping:('T1 -> 'T2 -> Async<'U>) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<'U>
/// Combines two asynchronous sequences into a sequence of pairs.
/// The resulting sequence stops when either of the argument sequences stop.
val zip : input1:AsyncSeq<'T1> -> input2:AsyncSeq<'T2> -> AsyncSeq<'T1 * 'T2>
/// Combines two asynchronous sequences into a sequence of pairs.
/// The values from sequences are retrieved in parallel.
/// The resulting sequence stops when either of the argument sequences stop.
val zipParallel : input1:AsyncSeq<'T1> -> input2:AsyncSeq<'T2> -> AsyncSeq<'T1 * 'T2>
/// Combines two asynchronous sequences using the specified function.
/// The resulting sequence stops when either of the argument sequences stop.
val zipWith : mapping:('T1 -> 'T2 -> 'U) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<'U>
/// Combines two asynchronous sequences using the specified function.
/// The values from sequences are retrieved in parallel.
/// The resulting sequence stops when either of the argument sequences stop.
val zipWithParallel : mapping:('T1 -> 'T2 -> 'U) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<'U>
/// Combines three asynchronous sequences using the specified asynchronous function.
/// The resulting sequence stops when any of the argument sequences stop.
val zipWithAsync3 : mapping:('T1 -> 'T2 -> 'T3 -> Async<'U>) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> source3:AsyncSeq<'T3> -> AsyncSeq<'U>
/// Combines three asynchronous sequences into a sequence of triples.
/// The resulting sequence stops when any of the argument sequences stop.
val zip3 : source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> source3:AsyncSeq<'T3> -> AsyncSeq<'T1 * 'T2 * 'T3>
/// Combines three asynchronous sequences using the specified function.
/// The resulting sequence stops when any of the argument sequences stop.
val zipWith3 : mapping:('T1 -> 'T2 -> 'T3 -> 'U) -> source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> source3:AsyncSeq<'T3> -> AsyncSeq<'U>
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence.
///
/// The specified function is asynchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val mapiAsync : mapping:(int64 -> 'T -> Async<'U>) -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence.
///
/// The specified function is synchronous (and the input sequence will
/// be asked for the next element after the processing of an element completes).
val mapi : mapping:(int64 -> 'T -> 'U) -> source:AsyncSeq<'T> -> AsyncSeq<'U>
[<System.Obsolete("Renamed to mapiAsync") >]
val zipWithIndexAsync : mapping:(int64 -> 'T -> Async<'U>) -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Feeds an async sequence of values into an async sequence of async functions.
val zappAsync : functions:AsyncSeq<('T -> Async<'U>)> -> source:AsyncSeq<'T> -> AsyncSeq<'U>
/// Feeds an async sequence of values into an async sequence of functions.
val zapp : functions:AsyncSeq<('T -> 'U)> -> source:AsyncSeq<'T> -> AsyncSeq<'U>
#if !FABLE_COMPILER
/// Merges two async sequences using the specified combine function. The resulting async sequence produces an element when either
/// input sequence produces an element, passing the new element from the emitting sequence and the previously emitted element from the other sequence.
/// If either of the input sequences is empty, the resulting sequence is empty.
val combineLatestWithAsync : combine:('T -> 'U -> Async<'V>) -> source1:AsyncSeq<'T> -> source2:AsyncSeq<'U> -> AsyncSeq<'V>
/// Merges two async sequences using the specified combine function. The resulting async sequence produces an element when either
/// input sequence produces an element, passing the new element from the emitting sequence and the previously emitted element from the other sequence.
/// If either of the input sequences is empty, the resulting sequence is empty.
val combineLatestWith : combine:('T -> 'U -> 'V) -> source1:AsyncSeq<'T> -> source2:AsyncSeq<'U> -> AsyncSeq<'V>
/// Merges two async sequences. The resulting async sequence produces an element when either
/// input sequence produces an element, passing the new element from the emitting sequence and the previously emitted element from the other sequence.
/// If either of the input sequences is empty, the resulting sequence is empty.
val combineLatest : source1:AsyncSeq<'a> -> source2:AsyncSeq<'b> -> AsyncSeq<'a * 'b>
#endif
/// Traverses an async sequence an applies to specified function such that if None is returned the traversal short-circuits
/// and None is returned as the result. Otherwise, the entire sequence is traversed and the result returned as Some.
val traverseOptionAsync : mapping:('T -> Async<'U option>) -> source:AsyncSeq<'T> -> Async<AsyncSeq<'U> option>
/// Traverses an async sequence an applies to specified function such that if Choice2Of2 is returned the traversal short-circuits
/// and Choice2Of2 is returned as the result. Otherwise, the entire sequence is traversed and the result returned as Choice1Of2.
val traverseChoiceAsync : mapping:('T -> Async<Choice<'U,'e>>) -> source:AsyncSeq<'T> -> Async<Choice<AsyncSeq<'U>,'e>>
/// Returns elements from an asynchronous sequence while the specified
/// predicate holds. The predicate is evaluated asynchronously.
val takeWhileAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
#if !FABLE_COMPILER
/// Returns elements from the argument async sequence until the specified signal completes or
/// the sequences completes.
val takeUntilSignal : signal:Async<unit> -> source:AsyncSeq<'T> -> AsyncSeq<'T>
[<System.Obsolete("Renamed to takeUntilSignal") >]
val takeUntil : signal:Async<unit> -> source:AsyncSeq<'T> -> AsyncSeq<'T>
#endif
/// Skips elements from an asynchronous sequence while the specified
/// predicate holds and then returns the rest of the sequence. The
/// predicate is evaluated asynchronously.
val skipWhileAsync : predicate:('T -> Async<bool>) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
#if !FABLE_COMPILER
/// Skips elements from an async sequence until the specified signal completes.
val skipUntilSignal : signal:Async<unit> -> source:AsyncSeq<'T> -> AsyncSeq<'T>
[<System.Obsolete("Renamed to skipUntilSignal") >]
val skipUntil : signal:Async<unit> -> source:AsyncSeq<'T> -> AsyncSeq<'T>
#endif
/// Returns elements from an asynchronous sequence while the specified
/// predicate holds. The predicate is evaluated synchronously.
val takeWhile : predicate:('T -> bool) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns elements from an asynchronous sequence while the specified
/// predicate holds. The predicate is evaluated synchronously.
/// Does return the first element that predicate fails
val takeWhileInclusive : predicate:('T -> bool) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Skips elements from an asynchronous sequence while the specified
/// predicate holds and then returns the rest of the sequence. The
/// predicate is evaluated asynchronously.
val skipWhile : predicate:('T -> bool) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns the first N elements of an asynchronous sequence
/// does not cast an exception if count is larger than the sequence length.
val take : count:int -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Alias for take
val truncate : count:int -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Skips the first N elements of an asynchronous sequence and
/// then returns the rest of the sequence unmodified.
val skip : count:int -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns an asynchronous sequence that skips the first element of the input sequence.
/// Returns an empty sequence if the source is empty.
val tail : source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Creates an async computation which iterates the AsyncSeq and collects the output into an array.
val toArrayAsync : source:AsyncSeq<'T> -> Async<'T []>
/// Creates an async computation which iterates the AsyncSeq and collects the output into a list.
val toListAsync : source:AsyncSeq<'T> -> Async<'T list>
#if !FABLE_COMPILER
/// Synchronously iterates the AsyncSeq and collects the output into a list.
val toListSynchronously : source:AsyncSeq<'T> -> 'T list
/// Synchronously iterates the AsyncSeq and collects the output into an array.
val toArraySynchronously : source:AsyncSeq<'T> -> 'T []
#endif
/// Flattens an AsyncSeq of synchronous sequences.
val concatSeq : source:AsyncSeq<#seq<'T>> -> AsyncSeq<'T>
/// Flattens an AsyncSeq of asynchronous sequences.
val concat : AsyncSeq<AsyncSeq<'T>> -> AsyncSeq<'T>
#if !FABLE_COMPILER
/// Yields a sequence ordered by keys.
/// This function returns a sequence that digests the whole initial sequence as soon as
/// that sequence is iterated. As a result this function should not be used with
/// large or infinite sequences.
val sort : source:AsyncSeq<'T> -> array<'T> when 'T : comparison
/// Applies a key-generating function to each element of an AsyncSeq and yield an array ordered by keys.
/// This function returns an array that digests the whole initial sequence as soon as
/// that sequence is iterated. As a result this function should not be used with
/// large or infinite sequences.
val sortBy : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> array<'T> when 'Key : comparison
/// Yields an array ordered descending by keys.
/// This function returns an array that digests the whole initial sequence as soon as
/// that sequence is iterated. As a result this function should not be used with
/// large or infinite sequences.
val sortDescending : source:AsyncSeq<'T> -> array<'T> when 'T : comparison
/// Applies a key-generating function to each element of an AsyncSeq and yield an array ordered descending by keys.
/// This function returns an array that digests the whole initial sequence as soon as
/// that sequence is iterated. As a result this function should not be used with
/// large or infinite sequences.
val sortByDescending : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> array<'T> when 'Key : comparison
/// Sorts the given async sequence using the given comparison function and returns an array.
/// This function returns an array that digests the whole initial sequence as soon as
/// that sequence is iterated. As a result this function should not be used with
/// large or infinite sequences.
val sortWith : comparer:('T -> 'T -> int) -> source:AsyncSeq<'T> -> array<'T>
#endif
/// Interleaves two async sequences of the same type into a resulting sequence. The provided
/// sequences are consumed in lock-step.
val interleave : source1:AsyncSeq<'T> -> source2:AsyncSeq<'T> -> AsyncSeq<'T>
/// Interleaves a sequence of async sequences into a resulting async sequence. The provided
/// sequences are consumed in lock-step.
val interleaveMany : source:#seq<AsyncSeq<'T>> -> AsyncSeq<'T>
/// Interleaves two async sequences into a resulting sequence. The provided
/// sequences are consumed in lock-step.
val interleaveChoice : source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<Choice<'T1,'T2>>
/// Buffer items from the async sequence into buffers of a specified size.
/// The last buffer returned may be less than the specified buffer size.
val chunkBySize : chunkSize:int -> source:AsyncSeq<'T> -> AsyncSeq<'T []>
/// Buffer items from the async sequence into buffers of a specified size.
/// The last buffer returned may be less than the specified buffer size.
[<Obsolete("Use AsyncSeq.chunkBySize instead")>]
val bufferByCount : bufferSize:int -> source:AsyncSeq<'T> -> AsyncSeq<'T []>
/// Groups consecutive elements of the async sequence that share the same key (as computed by an async projection)
/// and yields each group as a pair of the key and a list of elements.
val chunkByAsync<'T, 'Key when 'Key : equality> : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * 'T list>
/// Groups consecutive elements of the async sequence that share the same key (as computed by a projection)
/// and yields each group as a pair of the key and a list of elements.
val chunkBy<'T, 'Key when 'Key : equality> : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * 'T list>
#if !FABLE_COMPILER
/// Buffer items from the async sequence until a specified buffer size is reached or a specified amount of time is elapsed.
val bufferByCountAndTime : bufferSize:int -> timeoutMs:int -> source:AsyncSeq<'T> -> AsyncSeq<'T []>
/// Buffers items from the async sequence by the specified time interval.
/// If no items are received in an intervel and empty array is emitted.
val bufferByTime : timeMs:int -> source:AsyncSeq<'T> -> AsyncSeq<'T[]>
/// Merges two async sequences into an async sequence non-deterministically.
/// The resulting async sequence produces elements when any argument sequence produces an element.
val mergeChoice: source1:AsyncSeq<'T1> -> source2:AsyncSeq<'T2> -> AsyncSeq<Choice<'T1,'T2>>
/// Merges two async sequences of the same type into an async sequence non-deterministically.
/// The resulting async sequence produces elements when any argument sequence produces an element.
val merge: source1:AsyncSeq<'T> -> source2:AsyncSeq<'T> -> AsyncSeq<'T>
/// 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:seq<AsyncSeq<'T>> -> AsyncSeq<'T>
#endif
/// Returns an async sequence which contains no contiguous duplicate elements based on the specified comparison function.
val distinctUntilChangedWithAsync : mapping:('T -> 'T -> Async<bool>) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns an async sequence which contains no contiguous duplicate elements based on the specified comparison function.
val distinctUntilChangedWith : mapping:('T -> 'T -> bool) -> source:AsyncSeq<'T> -> AsyncSeq<'T>
/// Returns an async sequence which contains no contiguous duplicate elements.
val distinctUntilChanged : source:AsyncSeq<'T> -> AsyncSeq<'T> when 'T : equality
/// Returns an async sequence containing only distinct elements, determined by the given asynchronous key projection.
/// Elements are compared using structural equality on the projected key.
val distinctByAsync : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> AsyncSeq<'T> when 'Key : equality
/// Returns an async sequence containing only distinct elements, determined by the given key projection.
/// Elements are compared using structural equality on the projected key.
val distinctBy : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> AsyncSeq<'T> when 'Key : equality
/// Returns an async sequence containing only distinct elements.
/// Elements are compared using structural equality.
val distinct : source:AsyncSeq<'T> -> AsyncSeq<'T> when 'T : equality
#if FABLE_COMPILER
[<System.Obsolete("Use .GetEnumerator directly") >]
#endif
val getIterator : source:AsyncSeq<'T> -> (unit -> Async<'T option>)
#if !FABLE_COMPILER
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence.
///
/// The function is applied to elements in order and results are emitted in order,
/// but in parallel, without waiting for a prior mapping operation to complete.
/// Parallelism is bound by the ThreadPool.
val mapAsyncParallel : mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence.
///
/// The function is applied to elements in parallel, and results are emitted
/// in the order they complete (unordered), without preserving the original order.
/// This can provide better performance than mapAsyncParallel when order doesn't matter.
/// Parallelism is bound by the ThreadPool.
val mapAsyncUnorderedParallel : mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>
/// Builds a new asynchronous sequence whose elements are generated by
/// applying the specified function to all elements of the input sequence,
/// with at most <c>parallelism</c> mapping operations running concurrently.
///
/// The function is applied to elements in parallel (throttled), and results are emitted
/// in the order they complete (unordered), without preserving the original order.
val mapAsyncUnorderedParallelThrottled : parallelism:int -> mapping:('T -> Async<'U>) -> s:AsyncSeq<'T> -> AsyncSeq<'U>
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
/// and async sequences containing elements corresponding to the key.
///
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
/// completion of sub-sequences depends on completion of other sub-sequences.
[<CompilerMessage("The result of groupByAsync must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.", 9999)>]
val groupByAsync<'T, 'Key when 'Key : equality> : projection:('T -> Async<'Key>) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
/// Applies a key-generating function to each element and returns an async sequence containing unique keys
/// and async sequences containing elements corresponding to the key.
///
/// Note that the resulting async sequence has to be processed in parallel (e.g AsyncSeq.mapAsyncParallel) becaused
/// completion of sub-sequences depends on completion of other sub-sequences.
[<CompilerMessage("The result of groupBy must be consumed with a parallel combinator such as AsyncSeq.mapAsyncParallel. Sequential consumption will deadlock because sub-sequence completion depends on other sub-sequences being consumed concurrently.", 9999)>]
val groupBy<'T, 'Key when 'Key : equality> : projection:('T -> 'Key) -> source:AsyncSeq<'T> -> AsyncSeq<'Key * AsyncSeq<'T>>
#if (NETSTANDARD || NET)
/// Returns the input AsyncSeq as a BCL IAsyncEnumerable<'T>. Identity since AsyncSeq<'T> IS IAsyncEnumerable<'T> in v4.
[<Obsolete("AsyncSeq<'T> is now identical to IAsyncEnumerable<'T>. This function is a no-op and can be removed.")>]
val ofAsyncEnum<'T> : source: Collections.Generic.IAsyncEnumerable<'T> -> AsyncSeq<'T>
/// Returns the input AsyncSeq as a BCL IAsyncEnumerable<'T>. Identity since AsyncSeq<'T> IS IAsyncEnumerable<'T> in v4.
[<Obsolete("AsyncSeq<'T> is now identical to IAsyncEnumerable<'T>. This function is a no-op and can be removed.")>]
val toAsyncEnum<'T> : source: AsyncSeq<'T> -> Collections.Generic.IAsyncEnumerable<'T>
val ofIQueryable<'T> : source: Linq.IQueryable<'T> -> AsyncSeq<'T>
#endif
#endif
#if !FABLE_COMPILER
open System.Threading.Channels
/// Fills a channel writer with the values from an async seq.
/// The writer will be closed when the async seq completes or raises an error.
val toChannel<'T> : writer: ChannelWriter<'T> -> source: AsyncSeq<'T> -> Async<unit>
/// Creates an async seq from a channel reader.
/// The async seq will read values from the channel reader until it is closed.
/// If the reader raises an error than the sequence will raise it.
val fromChannel<'T> : reader: ChannelReader<'T> -> AsyncSeq<'T>
/// Transforms an async seq to a new one that fetches values ahead of time to improve throughput.
val prefetch<'T> : numberToPrefetch: int -> source: AsyncSeq<'T> -> AsyncSeq<'T>
#endif
/// An automatically-opened module that contains the `asyncSeq` builder and an extension method
[<AutoOpen>]
module AsyncSeqExtensions =
/// Builds an asynchronous sequence using the computation builder syntax
val asyncSeq : AsyncSeq.AsyncSeqBuilder
/// Converts asynchronous sequence to a synchronous blocking sequence.
/// The elements of the asynchronous sequence are consumed lazily.
type AsyncBuilder with
member For : seq:AsyncSeq<'T> * action:('T -> Async<unit>) -> Async<unit>
#if !FABLE_COMPILER
[<RequireQualifiedAccess>]
module Seq =
/// Converts asynchronous sequence to a synchronous blocking sequence.
/// The elements of the asynchronous sequence are consumed lazily.
val ofAsyncSeq : source:AsyncSeq<'T> -> seq<'T>
/// An async sequence source produces async sequences.
type AsyncSeqSrc<'T>
#endif
#if !FABLE_COMPILER
/// Operations on async sequence sources.
[<RequireQualifiedAccess>]
module AsyncSeqSrc =
/// Creates a new async sequence source.
val create : unit -> AsyncSeqSrc<'T>
/// Causes any async sequences created before the call to yield the item.
val put : item:'T -> src:AsyncSeqSrc<'T> -> unit
/// Closes the async sequence source casuing any created async sequences to complete.
val close : src:AsyncSeqSrc<'T> -> unit
/// Causes async sequence created before the call to raise an exception.
val error : exn:exn -> src:AsyncSeqSrc<'T> -> unit
/// Creates an async sequence which yields values as they are put into the source and terminates
/// when the source is closed. This sequence will yield items starting with the next put.
/// Many async sequences can be created from once source.
val toAsyncSeq : src:AsyncSeqSrc<'T> -> AsyncSeq<'T>
#endif