File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,7 @@ module TaskSeq =
163
163
// iter/map/collect functions
164
164
//
165
165
166
+ let cast source : taskSeq < 'U > = Internal.map ( SimpleAction( fun x -> box x :?> 'U)) source
166
167
let iter action source = Internal.iter ( SimpleAction action) source
167
168
let iteri action source = Internal.iter ( CountableAction action) source
168
169
let iterAsync action source = Internal.iter ( AsyncSimpleAction action) source
Original file line number Diff line number Diff line change @@ -87,6 +87,14 @@ module TaskSeq =
87
87
/// Create a taskSeq of an array of async.
88
88
val ofAsyncArray : source : Async < 'T > array -> taskSeq < 'T >
89
89
90
+ /// <summary>
91
+ /// Casts each item in the <paramref name="source" /> sequence asynchyronously. This function does unconstrainted casting,
92
+ /// by boxing the value and then casting it to the target type. For non-reference types, it is recommended
93
+ /// to use <see cref="TaskSeq.map" /> instead.
94
+ /// </summary>
95
+ /// <exception cref="InvalidCastException">Thrown when the function is unable to cast an item to the target type.</exception>
96
+ val cast : source : taskSeq < 'T > -> taskSeq < 'U >
97
+
90
98
/// Iterates over the taskSeq applying the action function to each item. This function is non-blocking
91
99
/// exhausts the sequence as soon as the task is evaluated.
92
100
val iter : action : ( 'T -> unit ) -> source : taskSeq < 'T > -> Task < unit >
You can’t perform that action at this time.
0 commit comments