Allows usage of AsyncSeq<'t>
and AsyncSeq<Result<'t, 'e>>
in Async<Result<'t, 'e>>
builders.
With Paket:
dotnet paket add FsToolkit.ErrorHandling.AsyncSeq
In a script:
#r "nuget: FSharp.Control.AsyncSeq"
#r "nuget: FsToolkit.ErrorHandling"
#r "nuget: FsToolkit.ErrorHandling.AsyncSeq"
open FSharp.Control
open FsToolkit.ErrorHandling
let xs =
asyncSeq {
1
2
3
}
asyncResult {
let mutable sum = 0
for x in xs do
sum <- sum + x
return sum
}
|> Async.RunSynchronously
|> printfn "%A"