An F# computation expression builder for writing System.Threading.Tasks with C# async/await-like syntax and behavior.
TaskBuilder.fs is an F# computation expression builder for System.Threading.Tasks that enables F# developers to write asynchronous code with syntax and behavior identical to C#'s async/await pattern. It solves the friction of converting between F#'s native Async type and the .NET standard Task model, providing a more intuitive experience for developers familiar with C# asynchronous programming.
F# developers working in .NET ecosystems where Task is the standard, especially those integrating with C# libraries or teams. It's also suitable for developers writing library or server-side code who need performance optimizations like automatic ConfigureAwait(false).
Developers choose TaskBuilder.fs because it offers C#-like async/await syntax in F# with minimal overhead, broad awaitable support, and a single-file public domain implementation. It provides better performance than alternatives like Task.ContinueWith or Async.StartAsTask while maintaining exact behavioral compatibility with C# tasks.
F# computation expression builder for System.Threading.Tasks
Provides a computation expression that mirrors C#'s async/await exactly, reducing friction for developers familiar with C# asynchronous programming, as shown in the README's side-by-side examples.
Offers an optional builder that automatically applies ConfigureAwait(false) for improved performance in library or server-side code, addressing common optimization needs without manual code changes.
Can bind any type with GetAwaiter(), GetResult(), and IsCompleted methods using let!, allowing seamless integration with various .NET asynchronous patterns beyond standard Tasks.
As a single-file, public domain codebase, it can be copied directly into projects with no dependencies, simplifying adoption and reducing deployment complexity.
The README explicitly states that tail recursion is not supported, which limits idiomatic F# coding patterns and requires workarounds like while loops for asynchronous loops.
Admits a small performance hit compared to C# compiler-generated state machines due to its general-purpose design, which might affect high-throughput applications.
The inclusion of V2 modules indicates past issues with compiler version compatibility, potentially complicating upgrades or integrations in mixed-version environments.
http://hopac.github.io/Hopac/Hopac.html
High performance System.Threading.(Value)Task computation expressions for F#
Asynchronous sequences for F#
F# Async workflow <--> .NET Task/ValueTask easy seamless interoperability library.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.