Compatability with AsyncSeq?
See original GitHub issueSo FSharp.Control.AsyncSeq
extends async
so that you can do this:
async {
let xs = asyncSeq {
yield 1
yield 2
yield 3
}
for x in xs do
printfn "%A" x
}
But this is not implemented for asyncResult
:
async {
let xs = asyncSeq {
yield 1
yield 2
yield 3
}
for x in xs do // Only seq allowed here
printfn "%A" x
}
I would be great if this worked, although I’m not sure how it could be implemented. Perhaps this is just a limitation of F#?
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
FSharp.Control.AsyncSeq
FSharp.Control.AsyncSeq is a collection of asynchronous programming utilities for F#. An AsyncSeq is a sequence in which individual elements are retrieved using ...
Read more >fsprojects/FSharp.Control.AsyncSeq
FSharp.Control.AsyncSeq is a collection of asynchronous programming utilities for F#. See the home page for details. The home page can be edited, forked...
Read more >Programming with F# asynchronous sequences
The asyncSeq { .. } block iterates over a (synchronous) list of URLs using a for loop. The body of the loop is...
Read more >Unordered F# AsyncSeq.mapParallel with throttling
Hmm. I'm not an async expert, but I don't think that AsyncSeq.fold works like that. If the first call in the sequence takes...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was able to design an
async
version like this:I’m still unsure of the best semantics though…
for
stop at the firstResult.Error
?AsyncSeq<Result<_, _>>
be supported?Basics here: https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/138