concept task in category f#
appears as: task, tasks, Task, tasks

This is an excerpt from Manning's book Get Programming with F#: A guide for .NET developers.
By moving to discriminated unions, you can be sure that you don’t accidentally mix up the wrong fields, and at the same time also know that none of your fields can ever be null (because DUs can never be assigned null). But you still haven’t solved the task completely: you want to model that only one of the contact details should be allowed at any point in time.
Introduced in .NET 4, tasks are a higher-level abstraction over threads. They’re much easier to work with and reason about, with good support for cancellation and parallelism, and so effectively became the de facto type in C# and VB .NET to use for performing background work.
Async.AwaitTask converts a task into an async workflow. Async.StartAsTask converts an async workflow into a task.
Listing 43.4. Unwrapping a Task<IHttpActionResult>
open System.Threading open System.Web.Http open System.Threading.Tasks let executeRequest (request:IHttpActionResult Task) = async { let! request = request |> Async.AwaitTask return! request.ExecuteAsync CancellationToken.None |> Async.AwaitTask } |> Async.RunSynchronously