Commit 24c47ce
[Repo Assist] Migrate AsyncSeq<'T> to BCL IAsyncEnumerable<'T> (v4.0) (#231)
* Migrate AsyncSeq<'T> to BCL System.Collections.Generic.IAsyncEnumerable<'T> (v4.0)
BREAKING CHANGE: AsyncSeq<'T> is now an alias for
System.Collections.Generic.IAsyncEnumerable<'T>, replacing the library's
own IAsyncEnumerator<'T> / IAsyncEnumerable<'T> pull-based interfaces.
Key changes:
- Remove public IAsyncEnumerator<'T> and IAsyncEnumerable<'T> interfaces.
Code with custom enumerator implementations must be updated.
- AsyncSeq<'T> = System.Collections.Generic.IAsyncEnumerable<'T>
- Internal machinery: IAsyncSeqEnumerator<'T> (pull-based) retained as an
implementation detail wrapped by AsyncSeqImpl<'T> adapter; not exported.
- AsyncSeqEnumeratorExtensions module: adds GetEnumerator() extension on
IAsyncEnumerable<'T> for internal use (hidden by .fsi).
- ofAsyncEnum / toAsyncEnum: now identity functions (no-ops).
- Bump version to 4.0.0-alpha.1.
- Update test that used old GetEnumerator()/MoveNext() API to BCL style.
All 190 tests pass.
Fixes #230.
Co-authored-by: Copilot <[email protected]>
* Initial plan
* Fix Fable compilation errors: guard ValueTask usage with #if FABLE_COMPILER
- In AsyncSeq.fs: wrap AsyncSeq<'T> type alias, AsyncSeqImpl<'T>, and
AsyncSeqEnumeratorExtensions with #if FABLE_COMPILER / #else / #endif.
For Fable: AsyncSeq<'T> is a library-specific interface with
GetEnumerator() returning IAsyncSeqEnumerator<'T>, avoiding ValueTask.
For non-Fable: keeps existing BCL IAsyncEnumerable<'T> alias and
ValueTask-based adapter.
- In AsyncSeq.fs: guard UnfoldAsyncEnumerator's IAsyncEnumerable<'T>
implementation of the library AsyncSeq<'T> interface instead.
- In AsyncSeq.fsi: add #if FABLE_COMPILER guard to expose
IAsyncSeqEnumerator<'T> and define AsyncSeq<'T> as interface for
Fable builds; keep BCL type alias for non-Fable.
Verified: dotnet build succeeds, 190/190 tests pass, dotnet fable
compiles without errors.
Co-authored-by: Copilot <[email protected]>
* Initial plan
* Initial plan: fix remaining Fable issues
Co-authored-by: dsyme <[email protected]>
* Guard getIterator [<Obsolete>] with #if FABLE_COMPILER in AsyncSeq.fsi
Co-authored-by: dsyme <[email protected]>
---------
Co-authored-by: Repo Assist <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Don Syme <[email protected]>
Co-authored-by: dsyme <[email protected]>1 parent 612fae6 commit 24c47ce
5 files changed
Lines changed: 234 additions & 219 deletions
File tree
- src/FSharp.Control.AsyncSeq
- tests
- FSharp.Control.AsyncSeq.Tests
- fable
0 commit comments