@@ -170,26 +170,25 @@ The [`AsyncSeq`][11] and `TaskSeq` libraries both operate on asynchronous sequen
170170
171171There are more differences:
172172
173- | | ` TaskSeq ` | ` AsyncSeq ` |
174- | ----------------------------| ---------------------------------------------------------------------------------------| ----------------------------------------------------------------------|
175- | ** Frameworks** | .NET 5.0+, NetStandard 2.1 | .NET 5.0+, NetStandard 2.0 and 2.1, .NET Framework 4.6.1+ |
176- | ** Underlying type** | ` System.Collections.Generic.IAsyncEnumerable<'T> ` | Its own type, also called ` IAsyncEnumerable<'T> ` , but not compatible |
177- | ** Implementation** | State machine (statically compiled) | No state machine, continuation style |
178- | ** Semantics** | ` seq ` -like: on-demand | ` seq ` -like: on-demand |
179- | ** Support ` let! ` ** | All ` task ` -like: ` Async<'T> ` , ` Task<'T> ` , ` ValueTask<'T> ` or any ` GetAwaiter() ` | ` Async<'T> ` only |
180- | ** Support ` do! ` ** | ` Async<unit> ` , ` Task<unit> ` and ` Task ` , ` ValueTask<unit> ` and ` ValueTask ` | ` Async<unit> ` only |
181- | ** Support ` yield! ` ** | ` IAsyncEnumerable<'T> ` , ` AsyncSeq ` , any sequence | ` AsyncSeq ` |
182- | ** Support ` for ` ** | ` IAsyncEnumerable<'T> ` , ` AsyncSeq ` , any sequence | ` AsyncSeq ` , any sequence |
183- | ** Behavior with ` yield ` ** | Zero allocations; no ` Task ` or even ` ValueTask ` created | Allocates an F# ` Async ` wrapped in a singleton ` AsyncSeq ` |
184- | ** Conversion to other** | ` TaskSeq.toAsyncSeq ` | ` AsyncSeq.toAsyncEnum ` |
185- | ** Conversion from other** | Implicit (` yield! ` ) or ` TaskSeq.ofAsyncSeq ` | ` AsyncSeq.ofAsyncEnum ` |
186- | ** Recursion in ` yield! ` ** | ** No** (requires F# support, upcoming) | Yes |
187- | ** Based on F# concept of** | ` task ` | ` async ` |
188- | ** ` MoveNextAsync ` ** | ` ValueTask<bool> ` | ` Async<'T option> ` |
189- | ** ` Current ` internals** | ` ValueOption<'T> ` | ` Option<'T> ` |
190- | ** Cancellation** | Implicit token governing iteration | Implicit token passed to each subtask |
191- | ** Performance** | Very high, negligible allocations | Slower, more allocations, due to using ` async ` |
192- | ** Parallelism** | Possible with ChildTask; support will follow | Supported explicitly |
173+ | | ` TaskSeq ` | ` AsyncSeq ` |
174+ | ----------------------------| ---------------------------------------------------------------------------------| ----------------------------------------------------------------------|
175+ | ** Frameworks** | .NET 5.0+, NetStandard 2.1 | .NET 5.0+, NetStandard 2.0 and 2.1, .NET Framework 4.6.1+ |
176+ | ** Underlying type** | ` System.Collections.Generic.IAsyncEnumerable<'T> ` | Its own type, also called ` IAsyncEnumerable<'T> ` , but not compatible |
177+ | ** Implementation** | State machine (statically compiled) | No state machine, continuation style |
178+ | ** Semantics** | ` seq ` -like: on-demand | ` seq ` -like: on-demand |
179+ | ** Support ` let! ` ** | All ` task ` -like: ` Async<'T> ` , ` Task<'T> ` , ` ValueTask<'T> ` or any ` GetAwaiter() ` | ` Async<'T> ` only |
180+ | ** Support ` do! ` ** | ` Async<unit> ` , ` Task<unit> ` and ` Task ` , ` ValueTask<unit> ` and ` ValueTask ` | ` Async<unit> ` only |
181+ | ** Support ` yield! ` ** | ` IAsyncEnumerable<'T> ` , ` AsyncSeq ` , any sequence | ` AsyncSeq ` |
182+ | ** Support ` for ` ** | ` IAsyncEnumerable<'T> ` , ` AsyncSeq ` , any sequence | ` AsyncSeq ` , any sequence |
183+ | ** Behavior with ` yield ` ** | Zero allocations; no ` Task ` or even ` ValueTask ` created | Allocates an F# ` Async ` wrapped in a singleton ` AsyncSeq ` |
184+ | ** Conversion to other** | ` TaskSeq.toAsyncSeq ` | ` AsyncSeq.toAsyncEnum ` |
185+ | ** Conversion from other** | Implicit (` yield! ` ) or ` TaskSeq.ofAsyncSeq ` | ` AsyncSeq.ofAsyncEnum ` |
186+ | ** Recursion in ` yield! ` ** | ** No** (requires F# support, upcoming) | Yes |
187+ | ** Based on F# concept of** | ` task ` | ` async ` |
188+ | ** ` MoveNextAsync ` ** impl | ` ValueTask<bool> ` | ` Async<'T option> ` |
189+ | ** Cancellation** | Implicit token governing iteration | Implicit token passed to each subtask |
190+ | ** Performance** | Very high, negligible allocations | Slower, more allocations, due to using ` async ` |
191+ | ** Parallelism** | Possible with ChildTask; support will follow | Supported explicitly |
193192
194193## Status & planning
195194
0 commit comments