Skip to content

Commit 4befb28

Browse files
bartelinkabelbraaksma
authored andcommitted
Tentative Rewording
1 parent 3ac6f9c commit 4befb28

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Latest version [can be installed from Nuget][nuget].
4848

4949
The `IAsyncEnumerable` interface was added to .NET in `.NET Core 3.0` and is part of `.NET Standard 2.1`. The main use-case was for iterative asynchronous enumeration over some resource. For instance, an event stream or a REST API interface with pagination, asynchronous reading over a list of files and accumulating the results, where each action can be modeled as a [`MoveNextAsync`][4] call on the [`IAsyncEnumerator<'T>`][5] given by a call to [`GetAsyncEnumerator()`][6].
5050

51-
Since the introduction of `task` in F# the call for a native implementation of _task sequences_ has grown, in particular because proper iterating over an `IAsyncEnumerable` has proven challenging, especially if one wants to avoid mutable variables. This library is an answer to that call and implements the same _resumable state machine_ approach with `taskSeq`.
51+
Since the introduction of `task` in F# the call for a native implementation of _task sequences_ has grown, in particular because proper iteration over an `IAsyncEnumerable` has proven challenging, especially if one wants to avoid mutable variables. This library is an answer to that call and applies the same _resumable state machine_ approach with `taskSeq`.
5252

5353
### Module functions
5454

@@ -58,9 +58,12 @@ As with `seq` and `Seq`, this library comes with a bunch of well-known collectio
5858

5959
### `taskSeq` computation expressions
6060

61-
The `taskSeq` computation expression can be used just like using `seq`. On top of that, it adds support for working with tasks through `let!` and
62-
looping over a normal or asynchronous sequence (one that implements `IAsyncEnumerable<'T>'`). You can use `yield!` and `yield` and there's support
63-
for `use` and `use!`, `try-with` and `try-finally` and `while` loops within the task sequence expression:
61+
The `taskSeq` computation expression can be used just like using `seq`.
62+
Additionally, it adds support for working with `Task`s through `let!` and
63+
looping over both normal and asynchronous sequences (ones that implement
64+
`IAsyncEnumerable<'T>'`). You can use `yield!` and `yield` and there's support
65+
for `use` and `use!`, `try-with` and `try-finally` and `while` loops within
66+
the task sequence expression:
6467

6568
### Installation
6669

@@ -183,7 +186,7 @@ The _resumable state machine_ backing the `taskSeq` CE is now finished and _rest
183186

184187
### Progress and implemented `TaskSeq` module functions
185188

186-
We are working hard on getting a full set of module functions on `TaskSeq` that can be used with `IAsyncEnumerable` sequences. Our guide is the set of F# `Seq` functions in F# Core and, where applicable, the functions provided from `AsyncSeq`. Each implemented function is documented through XML doc comments to provide the necessary context-sensitive help.
189+
We are working hard on getting a full set of module functions on `TaskSeq` that can be used with `IAsyncEnumerable` sequences. Our guide is the set of F# `Seq` functions in F# Core and, where applicable, the functions provided by `AsyncSeq`. Each implemented function is documented through XML doc comments to provide the necessary context-sensitive help.
187190

188191
The following is the progress report:
189192

@@ -327,12 +330,17 @@ The following is the progress report:
327330

328331
## More information
329332

330-
### Further reading `IAsyncEnumerable`
333+
### The AsyncSeq library
334+
335+
If you're looking to use `IAsyncEnumerable` with `async` and not `task`, the existing [`AsyncSeq`][11] library already provides excellent coverage of that use case. While `TaskSeq` is intended to interoperate with `async` as `task` does, it's not intended to provide an `AsyncSeq` type (at least not yet).
336+
337+
In short, if your application is using `Async` (and the parallelism features stemming from that), consider using the `AsyncSeq` library instead.
338+
339+
### Further reading on `IAsyncEnumerable`
331340

332341
- A good C#-based introduction [can be found in this blog][8].
333342
- [An MSDN article][9] written shortly after it was introduced.
334343
- Converting a `seq` to an `IAsyncEnumerable` [demo gist][10] as an example, though `TaskSeq` contains many more utility functions and uses a slightly different approach.
335-
- If you're looking for using `IAsyncEnumerable` with `async` and not `task`, the excellent [`AsyncSeq`][11] library should be used. While `TaskSeq` is intended to consume `async` just like `task` does, it won't create an `AsyncSeq` type (at least not yet). If you want classic Async and parallelism, you should get this library instead.
336344

337345
### Further reading on resumable state machines
338346

0 commit comments

Comments
 (0)