An F# library providing additional computation expressions for ValueTask, ColdTask, CancellableTask, and parallel Async operations.
IcedTasks is an F# library that provides additional computation expressions for asynchronous and task-based programming. It extends F#'s built-in task and async workflows with specialized variants like ValueTask, ColdTask, CancellableTask, and parallel Async, addressing performance, lazy evaluation, and cancellation flow needs. The library leverages F# 6.0's Resumable Code feature to offer more efficient and expressive asynchronous programming patterns.
F# developers building high-performance, asynchronous applications who need fine-grained control over task execution, cancellation, and parallelism. It's particularly useful for those working with .NET's Task/ValueTask APIs in scenarios requiring cold task semantics or implicit cancellation token propagation.
Developers choose IcedTasks because it fills gaps in F#'s standard asynchronous programming model, offering optimized computation expressions with better performance (via ValueTask), lazy evaluation (ColdTask), and seamless cancellation support. Its polyfills and enhancements provide a more robust and expressive alternative to built-in F# task and async workflows.
F# Cold Tasks and Cancellable Tasks
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides computation expressions for ValueTask, reducing heap allocations in synchronous paths compared to standard Task, as highlighted in the README's focus on performance benefits for hot scenarios.
CancellableTask and CancellableValueTask allow implicit CancellationToken propagation, eliminating the need to pass tokens explicitly, similar to F# Async but for Task-based workflows.
ParallelAsync enables parallel execution of Async computations using applicative syntax (`and!`), optimizing for concurrent workloads without manual threading.
AsyncEx extends F# Async with support for IAsyncDisposable, direct binding to Task/ValueTask, and improved exception handling that avoids AggregateException wrapping.
With eight different computation expressions (e.g., ValueTask, ColdTask, CancellableTask), developers must understand hot vs cold semantics and cancellation propagation, which can be overwhelming for newcomers.
Leverages Resumable Code from F# 6.0, making it incompatible with projects using older F# versions or .NET frameworks without this feature, as noted in the TFM requirements.
The variety of CEs might encourage over-complication in simple scenarios where standard F# Async or Task would suffice, leading to unnecessary code complexity and maintenance overhead.