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 =
163163 // iter/map/collect functions
164164 //
165165
166+ let cast source : taskSeq < 'U > = Internal.map ( SimpleAction( fun x -> box x :?> 'U)) source
166167 let iter action source = Internal.iter ( SimpleAction action) source
167168 let iteri action source = Internal.iter ( CountableAction action) source
168169 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 =
8787 /// Create a taskSeq of an array of async.
8888 val ofAsyncArray : source : Async < 'T > array -> taskSeq < 'T >
8989
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+
9098 /// Iterates over the taskSeq applying the action function to each item. This function is non-blocking
9199 /// exhausts the sequence as soon as the task is evaluated.
92100 val iter : action : ( 'T -> unit ) -> source : taskSeq < 'T > -> Task < unit >
You can’t perform that action at this time.
0 commit comments