-
Notifications
You must be signed in to change notification settings - Fork 8
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naming notes #77
Comments
Anyway, I just want to point out that the TaskSeq naming isn't perfect Putting aside legacy, the ideal for naming and simplicity purposes would be
Then we'd be back to the nicest position that there is just That makes me wonder if we should already be deprecating/renaming FSharp.Control.AsyncSeq to make room for this. Maybe renaming to |
I see your point, but I'm not sold on this. F# Core has two distinct builders, one for People have come to associate If we want to move forward to a single library approach for asynchronous sequences, it's likely that some of the current library functions of Also, since most F# programmers that I know have typically moved from I realize there's no perfect solution here. I can certainly see a use-case, and definitely until Also, with 250k downloads of the latest version alone, and 1.4M in total, deprecating |
PS: yes, I can see this confusion. The reason I started all of this was that in my team people were literally writing code that had This prompted me, among giving some education on Which reminds me, I should probably remove functions like |
Noticed something else: let x = asyncSeq {
yield 1
}
x :> IAsyncEnumerable<_> // not possible We could also implement that interface, though it'll be confusing, as the internally used interface is same-named, they only differ in the naming of getting the enumerator: I know there's Not saying there isn't any confusion now. But I just think that having the two disparate yet seemingly equal worlds: tasks and asyncs in the F# ecosystem maybe the best of all the bad choices we have ;). |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
I do notice the name "TaskSeq" is confusing some people - people thinking this is about "sequences of tasks". I'm not sure what to do about this.
While thinking about this I included some general notes on naming in this space, see below
F# IEnumerator
HotSynchronousFastEnumerator
IEnumerable<T>
F# IEnumerable = Seq
ColdSynchronousFastEnumerable
unit -> IEnumerable<T>
.NET/F#/C# Task = C# async/await
HotAsynchronousFastValue
Task<T>
IcedTask ColdTask
ColdAsynchronousFastValueFactory
unit -> Task<T>
IcedTask CancellableTask
ColdAsynchronousFastCancellableValueFactory
CancellationToken -> Task<T>
Async = F# async
ColdAsynchronousCancellableValueFactory
CancellationToken -> Task<T>
Current F# AsyncSeq
ColdAsynchronousCancellableEnumerable
CancellationToken -> IAsyncEnumerator<T>
Current F# TaskSeq
ColdAsynchronousHalfCancellableEnumerable
CancellationToken -> IAsyncEnumerator<T>
I'm leaving the question of tailcalls off the list, as much as I'd like to address that.
It's worth noting that at a high level there's no real logical difference between
CancellableTask
and F#Async<_>
. Nor between F#TaskSeq
and F#AsyncSeq
.The sweet spot for F# is really Cold+RunMany+Asynchronous+Fast+Cancellable+Tailcalls, which is what TaskSeq is close to being technically (except tailcalls, sadly).
The text was updated successfully, but these errors were encountered: