FSharpPlus


Async Module

Additional operations on Async

Functions and values

Function or value Description

Async.apply f x

Full Usage: Async.apply f x

Parameters:
    f : Async<('a -> 'b)> - Async workflow returning a function.
    x : Async<'a> - Async workflow returning a value.

Returns: Async<'b>

Creates an async workflow that is the result of applying the resulting function of an async workflow to the resulting value of another async workflow.

f : Async<('a -> 'b)>

Async workflow returning a function.

x : Async<'a>

Async workflow returning a value.

Returns: Async<'b>

Async.join x

Full Usage: Async.join x

Parameters:
Returns: Async<'a>

Flatten two nested asyncs into one.

x : Async<Async<'a>>
Returns: Async<'a>

Async.lift2 f x y

Full Usage: Async.lift2 f x y

Parameters:
    f : 'a -> 'b -> 'c - The mapping function.
    x : Async<'a> - First async workflow.
    y : Async<'b> - Second async workflow.

Returns: Async<'c>

Creates an async workflow from two workflows 'x' and 'y', mapping its results with 'f'.

Workflows are run in sequence.

f : 'a -> 'b -> 'c

The mapping function.

x : Async<'a>

First async workflow.

y : Async<'b>

Second async workflow.

Returns: Async<'c>

Async.lift3 f x y z

Full Usage: Async.lift3 f x y z

Parameters:
    f : 'e -> 'f -> 'g -> 'h - The mapping function.
    x : Async<'e> - First async workflow.
    y : Async<'f> - Second async workflow.
    z : Async<'g> - third async workflow.

Returns: Async<'h>

Creates an async workflow from three workflows 'x', 'y' and 'z', mapping its results with 'f'.

Workflows are run in sequence.

f : 'e -> 'f -> 'g -> 'h

The mapping function.

x : Async<'e>

First async workflow.

y : Async<'f>

Second async workflow.

z : Async<'g>

third async workflow.

Returns: Async<'h>

Async.map f x

Full Usage: Async.map f x

Parameters:
    f : 'a -> 'b
    x : Async<'a>

Returns: Async<'b>

Creates an async workflow from another workflow 'x', mapping its result with 'f'.

f : 'a -> 'b
x : Async<'a>
Returns: Async<'b>

Async.map2 mapper async1 async2

Full Usage: Async.map2 mapper async1 async2

Parameters:
    mapper : 'T1 -> 'T2 -> 'U - The mapping function.
    async1 : Async<'T1> - First async workflow.
    async2 : Async<'T2> - Second async workflow.

Returns: Async<'U>

Creates an async workflow from two workflows, mapping its results with a specified function.

Similar to lift2 but although workflows are started in sequence they might end independently in different order and all errors are collected.

mapper : 'T1 -> 'T2 -> 'U

The mapping function.

async1 : Async<'T1>

First async workflow.

async2 : Async<'T2>

Second async workflow.

Returns: Async<'U>

Async.map3 mapper async1 async2 async3

Full Usage: Async.map3 mapper async1 async2 async3

Parameters:
    mapper : 'T1 -> 'T2 -> 'T3 -> 'U - The mapping function.
    async1 : Async<'T1> - First async workflow.
    async2 : Async<'T2> - Second async workflow.
    async3 : Async<'T3> - third async workflow.

Returns: Async<'U>

Creates an async workflow from three workflows, mapping its results with a specified function.

Similar to lift3 but although workflows are started in sequence they might end independently in different order and all errors are collected.

mapper : 'T1 -> 'T2 -> 'T3 -> 'U

The mapping function.

async1 : Async<'T1>

First async workflow.

async2 : Async<'T2>

Second async workflow.

async3 : Async<'T3>

third async workflow.

Returns: Async<'U>

Async.raise ex

Full Usage: Async.raise ex

Parameters:
    ex : exn

Returns: Async<'T>

Raises an exception in the async workflow

ex : exn
Returns: Async<'T>

Async.zip async1 async2

Full Usage: Async.zip async1 async2

Parameters:
Returns: Async<'T1 * 'T2>

Creates an async workflow from two workflows, tupling its results.

Similar to zipSequentially but although workflows are started in sequence they might end independently in different order and all errors are collected.

async1 : Async<'T1>
async2 : Async<'T2>
Returns: Async<'T1 * 'T2>

Async.zip3 async1 async2 async3

Full Usage: Async.zip3 async1 async2 async3

Parameters:
Returns: Async<'T1 * 'T2 * 'T3>

Creates an async workflow from three workflows, tupling its results.

Similar to zipSequentially but although workflows are started in sequence they might end independently in different order and all errors are collected.

async1 : Async<'T1>
async2 : Async<'T2>
async3 : Async<'T3>
Returns: Async<'T1 * 'T2 * 'T3>

Async.zipSequentially x y

Full Usage: Async.zipSequentially x y

Parameters:
Returns: Async<'a * 'b>

Creates an async workflow from two workflows 'x' and 'y', tupling its results.

x : Async<'a>
y : Async<'b>
Returns: Async<'a * 'b>