FSharpPlus


Task Module

Additional operations on Task<'T>

Functions and values

Function or value Description

Task.apply f x

Full Usage: Task.apply f x

Parameters:
    f : Task<('T -> 'U)> - Task workflow returning a function
    x : Task<'T> - Task workflow returning a value

Returns: Task<'U>

Creates a task workflow that is the result of applying the resulting function of a task workflow to the resulting value of another task workflow

f : Task<('T -> 'U)>

Task workflow returning a function

x : Task<'T>

Task workflow returning a value

Returns: Task<'U>

Task.bind f source

Full Usage: Task.bind f source

Parameters:
Returns: Task<'U>

Creates a task workflow from 'source' workflow, mapping and flattening its result with 'f'.

f : 'T -> Task<'U>
source : Task<'T>
Returns: Task<'U>

Task.ignore task

Full Usage: Task.ignore task

Parameters:
Returns: Task<unit>

Creates a task that ignores the result of the source task.

It can be used to convert non-generic Task to unit Task.

task : Task
Returns: Task<unit>

Task.join source

Full Usage: Task.join source

Parameters:
Returns: Task<'T>

Flattens two nested tasks into one.

source : Task<Task<'T>>
Returns: Task<'T>

Task.map f source

Full Usage: Task.map f source

Parameters:
    f : 'T -> 'U
    source : Task<'T>

Returns: Task<'U>

Creates a task workflow from 'source' another, mapping its result with 'f'.

f : 'T -> 'U
source : Task<'T>
Returns: Task<'U>

Task.map2 f x y

Full Usage: Task.map2 f x y

Parameters:
    f : 'T -> 'U -> 'V - The mapping function.
    x : Task<'T> - First task workflow.
    y : Task<'U> - Second task workflow.

Returns: Task<'V>

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

Workflows are run in sequence.

f : 'T -> 'U -> 'V

The mapping function.

x : Task<'T>

First task workflow.

y : Task<'U>

Second task workflow.

Returns: Task<'V>

Task.map3 f x y z

Full Usage: Task.map3 f x y z

Parameters:
    f : 'T -> 'U -> 'V -> 'W - The mapping function.
    x : Task<'T> - First task workflow.
    y : Task<'U> - Second task workflow.
    z : Task<'V> - Third task workflow.

Returns: Task<'W>

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

Workflows are run in sequence.

f : 'T -> 'U -> 'V -> 'W

The mapping function.

x : Task<'T>

First task workflow.

y : Task<'U>

Second task workflow.

z : Task<'V>

Third task workflow.

Returns: Task<'W>

Task.raise e

Full Usage: Task.raise e

Parameters:
    e : exn

Returns: Task<'U>

Raises an exception in the Task

e : exn
Returns: Task<'U>

Task.tryFinally body compensation

Full Usage: Task.tryFinally body compensation

Parameters:
    body : unit -> Task<'T>
    compensation : unit -> unit

Returns: Task<'T>

Used to de-sugar try .. finally .. blocks in Computation Expressions.

body : unit -> Task<'T>
compensation : unit -> unit
Returns: Task<'T>

Task.tryWith body compensation

Full Usage: Task.tryWith body compensation

Parameters:
    body : unit -> Task<'T>
    compensation : exn -> Task<'T>

Returns: Task<'T>

Used to de-sugar try .. with .. blocks in Computation Expressions.

body : unit -> Task<'T>
compensation : exn -> Task<'T>
Returns: Task<'T>

Task.using disp body

Full Usage: Task.using disp body

Parameters:
    disp : 'a
    body : 'a -> Task<'a0>

Returns: Task<'a0>

Used to de-sugar use .. blocks in Computation Expressions.

disp : 'a
body : 'a -> Task<'a0>
Returns: Task<'a0>

Task.zip x y

Full Usage: Task.zip x y

Parameters:
Returns: Task<'T * 'U>

Creates a task workflow from two workflows 'x' and 'y', tupling its results.

x : Task<'T>
y : Task<'U>
Returns: Task<'T * 'U>