Table of contents
Collapse the table of content
Expand the table of content

Control.AsyncBuilder Class (F#)

Den Delimarsky|Last Updated: 8/18/2017
1 Contributor

The type of the async operator, used to build workflows for asynchronous computations.

Namespace/Module Path: Microsoft.FSharp.Control

Assembly: FSharp.Core (in FSharp.Core.dll)


type AsyncBuilder =
new AsyncBuilder : unit -> AsyncBuilder
member this.Bind : Async<'T> * ('T -> Async<'U>) -> Async<'U>
member this.Combine : Async<unit> * Async<'T> -> Async<'T>
member this.Delay : (unit -> Async<'T>) -> Async<'T>
member this.For : seq<'T> * ('T -> Async<unit>) -> Async<unit>
member this.Return : 'T -> Async<'T>
member this.ReturnFrom : Async<'T> -> Async<'T>
member this.TryFinally : Async<'T> * (unit -> unit) -> Async<'T>
member this.TryWith : Async<'T> * (exn -> Async<'T>) -> Async<'T>
member this.Using : 'T * ('T -> Async<'U>) -> Async<'U>
member this.While : (unit -> bool) * Async<unit> -> Async<unit>
member this.Zero : unit -> Async<unit>


For general information on computation expressions and builder types, see Computation Expressions (F#).

This type is named FSharpAsyncBuilder in compiled assemblies. If accessing the type from a language other than F#, or through reflection, use this name.


newGenerates an object used to build asynchronous computations using F# computation expressions. The value async is a pre-defined instance of this type. A cancellation check is performed when the computation is executed.

Instance Members

BindImplements let! in asynchronous computations.
CombineCreates an asynchronous computation that first runs computation1 and then runs computation2, returning the result of computation2.
DelayCreates an asynchronous computation that runs a function.
ForImplements the for expression in asynchronous computations.
ReturnImplements the return expression in asynchronous computations. Creates an asynchronous computation that returns the specified result.
ReturnFromImplements the return! keyword for asynchronous computations. This function delegates to the input computation.
TryFinallyImplements try...finally in asynchronous computations.
TryWithImplements try...with in asynchronous computations.
UsingImplements the use and use! keywords in asynchronous computation expressions.
WhileImplements the while keyword in asynchronous computation expressions.
ZeroCreates an asynchronous computation that does nothing and returns ().


Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Microsoft.FSharp.Control Namespace (F#)

© 2019 Microsoft