Conversation
…le<'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 <223556219+Copilot@users.noreply.github.com>
dsyme
requested changes
Feb 22, 2026
4 tasks
Contributor
6 tasks
…MPILER - 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 <223556219+Copilot@users.noreply.github.com>
[WIP] Fix AsyncSeq migration issues and Fable feedback
Contributor
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Co-authored-by: dsyme <7204669+dsyme@users.noreply.github.com>
Fix Fable compatibility: guard `getIterator` obsolete attribute and complete #if FABLE_COMPILER cleanup
dsyme
approved these changes
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Repo Assist here — I'm an automated AI assistant for this repository.
Implements the direction given in #230 by @dsyme: migrate
AsyncSeq<'T>to use the standard .NETSystem.Collections.Generic.IAsyncEnumerable<'T>as the underlying type, with a v4 major version bump.Fixes #230.What changed
type AsyncSeq<'T> = IAsyncEnumerable<'T>(custom library interface)type AsyncSeq<'T> = System.Collections.Generic.IAsyncEnumerable<'T>(BCL)IAsyncEnumerator<'T>(custom,MoveNext(): Async<'T option>)IAsyncSeqEnumerator<'T>(not exported)ofAsyncEnum/toAsyncEnumperformed BCL↔custom conversionofAsyncEnum/toAsyncEnumare now identity functionss.GetEnumerator()returningIAsyncEnumerator<'T>s.GetAsyncEnumerator(ct)returning BCLIAsyncEnumerator<'T>How the internal machinery is preserved
The library's internal pull-based generator infrastructure (
Async<'T option>) is unchanged. A newAsyncSeqImpl<'T>class wraps the internal enumerator factory as a BCLIAsyncEnumerable<'T>. An internalGetEnumerator()extension (not exported via.fsi) onIAsyncEnumerable<'T>bridges the two worlds for internal use.Breaking changes for downstream users
IAsyncEnumerator<'T>/IAsyncEnumerable<'T>from this library needs updating.GetEnumerator()/.MoveNext()directly must switch to.GetAsyncEnumerator(ct)/.MoveNextAsync()ofAsyncEnumandtoAsyncEnumare now no-ops (kept for source compatibility but can be removed in v4 final)What's still TODO before final v4.0.0
#if FABLE_COMPILERpaths need verificationofAsyncEnum/toAsyncEnumstubs or mark[(Obsolete)]IAsyncSeqEnumerator<'T>/AsyncSeqImpl<'T>should be hidden more aggressively (currently un-exported via.fsibut not marked[(EditorBrowsable(Never))])Test Status
✅ Build succeeded — both
netstandard2.0andnetstandard2.1targets✅ All 190 tests pass — one test updated from old pull-based API to BCL
GetAsyncEnumerator/MoveNextAsyncpattern