Skip to content

Commit cf73574

Browse files
github-actions[bot]Copilotdsyme
authored
Add v4.0 migration notes to README and docs (#238)
- README.md: add 'Version 4.0 — BCL IAsyncEnumerable Compatibility' section explaining the type alias, zero-cost interop, and how to migrate from v3.x - docs/index.md: add v4 callout with migration link - docs/AsyncSeq.fsx: add v4 note explaining IAsyncEnumerable<'T> interop Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <[email protected]> Co-authored-by: Don Syme <[email protected]>
1 parent dc44d26 commit cf73574

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
See [the home page](http://fsprojects.github.io/FSharp.Control.AsyncSeq/) for details. The home page can be [edited, forked or cloned](https://github.com/fsprojects/FSharp.Control.AsyncSeq/tree/master/docs/content)
66
Please contribute to this project. Don't ask for permission, just fork the repository and send pull requests.
77

8+
## Version 4.0 — BCL IAsyncEnumerable Compatibility
9+
10+
As of **v4.0**, `AsyncSeq<'T>` is a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>` (the BCL type). This means:
11+
12+
- `AsyncSeq<'T>` values are directly usable anywhere `IAsyncEnumerable<'T>` is expected (e.g. `await foreach` in C#, `IAsyncEnumerable<T>` APIs).
13+
- `IAsyncEnumerable<'T>` values (from EF Core, ASP.NET Core streaming endpoints, etc.) can be used directly wherever `AsyncSeq<'T>` is expected — no conversion needed.
14+
- The `AsyncSeq.ofAsyncEnum` and `AsyncSeq.toAsyncEnum` helpers are now **no-ops** and have been marked `[<Obsolete>]`. Remove any calls to them.
15+
16+
### Migrating from v3.x
17+
18+
If you called `.GetEnumerator()` / `.MoveNext()` directly on an `AsyncSeq<'T>`, update to `.GetAsyncEnumerator(ct)` / `.MoveNextAsync()` (the `IAsyncEnumerator<'T>` BCL contract). All other `AsyncSeq` module combinators are unchanged.
19+
820
# Maintainer(s)
921

1022
- [@dsyme](https://github.com/dsyme)

docs/AsyncSeq.fsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ latter based on a "synchronous push". Analogs for most operations defined for `S
2626
`AsyncSeq`. The power of `AsyncSeq` lies in that many of these operations also have analogs based on `Async`
2727
allowing composition of complex asynchronous workflows.
2828
29+
> **v4.0 and later:** `AsyncSeq<'T>` is a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>`.
30+
> Any `IAsyncEnumerable<'T>` value (e.g. from EF Core, ASP.NET Core channels, or `taskSeq { }`) can be used
31+
> directly as an `AsyncSeq<'T>` without conversion, and vice-versa.
32+
2933
The `AsyncSeq` type is located in the `FSharp.Control.AsyncSeq.dll` assembly which can be loaded in F# Interactive as follows:
3034
*)
3135

docs/index.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@ FSharp.Control.AsyncSeq
33

44
FSharp.Control.AsyncSeq is a collection of asynchronous programming utilities for F#.
55

6-
An AsyncSeq is a sequence in which individual elements are retrieved using an `Async` computation.
6+
An `AsyncSeq<'T>` is a sequence in which individual elements are retrieved using an `Async` computation.
77
The power of `AsyncSeq` lies in that many of these operations also have analogs based on `Async`
88
allowing composition of complex asynchronous workflows, including compositional cancellation.
99

10+
> **v4.0:** `AsyncSeq<'T>` is now a type alias for `System.Collections.Generic.IAsyncEnumerable<'T>`.
11+
> Values flow freely between `AsyncSeq<'T>` and `IAsyncEnumerable<'T>` without any conversion.
12+
> `AsyncSeq.ofAsyncEnum` / `AsyncSeq.toAsyncEnum` are now no-ops and marked obsolete — remove them.
13+
> See the [README](https://github.com/fsprojects/FSharp.Control.AsyncSeq#version-40--bcl-iasyncenumerable-compatibility) for migration notes.
14+
1015
An `AsyncSeq<'a>` can be generated using computation expression syntax much like `seq<'a>`:
1116

1217
let oneThenTwo = asyncSeq {

0 commit comments

Comments
 (0)