Header menu logo IcedTasks

ValueTask Module

Contains functional helper functions for composing and converting pooling-backed values.

Functions and values

Function or value Description

ValueTask.apply applicable cTask

Full Usage: ValueTask.apply applicable cTask

Parameters:
    applicable : ValueTask<('input -> 'output)> - A function wrapped in a PoolingValueTasks
    cTask : ValueTask<'input> - The value.

Returns: ValueTask<'output> The result of the applicable.
Modifiers: inline
Type parameters: 'input, 'output

Allows chaining of PoolingValueTasks.

applicable : ValueTask<('input -> 'output)>

A function wrapped in a PoolingValueTasks

cTask : ValueTask<'input>

The value.

Returns: ValueTask<'output>

The result of the applicable.

ValueTask.bind binder cTask

Full Usage: ValueTask.bind binder cTask

Parameters:
    binder : 'input -> ValueTask<'output> - The continuation.
    cTask : ValueTask<'input> - The value.

Returns: ValueTask<'output> The result of the binder.
Modifiers: inline
Type parameters: 'input, 'output

Allows chaining of PoolingValueTasks.

binder : 'input -> ValueTask<'output>

The continuation.

cTask : ValueTask<'input>

The value.

Returns: ValueTask<'output>

The result of the binder.

ValueTask.map mapper cTask

Full Usage: ValueTask.map mapper cTask

Parameters:
    mapper : 'input -> 'output - The continuation.
    cTask : ValueTask<'input> - The value.

Returns: ValueTask<'output> The result of the mapper wrapped in a PoolingValueTasks.
Modifiers: inline
Type parameters: 'input, 'output

Allows chaining of PoolingValueTasks.

mapper : 'input -> 'output

The continuation.

cTask : ValueTask<'input>

The value.

Returns: ValueTask<'output>

The result of the mapper wrapped in a PoolingValueTasks.

ValueTask.ofTask task

Full Usage: ValueTask.ofTask task

Parameters:
    task : Task<'T> - The task to wrap.

Returns: ValueTask<'T> A ValueTask that represents the same operation as task.
Modifiers: inline
Type parameters: 'T

Wraps a Task as a ValueTask.

task : Task<'T>

The task to wrap.

Returns: ValueTask<'T>

A ValueTask that represents the same operation as task.

ValueTask.ofTaskUnit task

Full Usage: ValueTask.ofTaskUnit task

Parameters:
    task : Task - The task to wrap.

Returns: ValueTask A ValueTask that represents the same operation as task.
Modifiers: inline

Wraps a non-generic Task as a non-generic ValueTask.

task : Task

The task to wrap.

Returns: ValueTask

A ValueTask that represents the same operation as task.

ValueTask.ofUnit vtask

Full Usage: ValueTask.ofUnit vtask

Parameters:
    vtask : ValueTask - The non-generic ValueTask to convert.

Returns: ValueTask<unit> A ValueTask whose result is unit.
Modifiers: inline

Converts a non-generic ValueTask to a pooling-backed ValueTask of unit.

vtask : ValueTask

The non-generic ValueTask to convert.

Returns: ValueTask<unit>

A ValueTask whose result is unit.

ValueTask.singleton item

Full Usage: ValueTask.singleton item

Parameters:
    item : 'item - The item to be the result of the ValueTask.

Returns: ValueTask<'item> A ValueTask with the item as the result.
Modifiers: inline
Type parameters: 'item

Lifts an item to a ValueTask.

item : 'item

The item to be the result of the ValueTask.

Returns: ValueTask<'item>

A ValueTask with the item as the result.

ValueTask.toTask vtask

Full Usage: ValueTask.toTask vtask

Parameters:
    vtask : ValueTask<'T> - The ValueTask to convert.

Returns: Task<'T> The wrapped Task if one exists, or a new Task that represents the ValueTask result.
Modifiers: inline
Type parameters: 'T

Retrieves a Task that represents the supplied ValueTask.

vtask : ValueTask<'T>

The ValueTask to convert.

Returns: Task<'T>

The wrapped Task if one exists, or a new Task that represents the ValueTask result.

ValueTask.toTaskUnit vtask

Full Usage: ValueTask.toTaskUnit vtask

Parameters:
    vtask : ValueTask - The ValueTask to convert.

Returns: Task The Task representation of vtask.
Modifiers: inline

Retrieves a non-generic Task that represents the supplied non-generic ValueTask.

vtask : ValueTask

The ValueTask to convert.

Returns: Task

The Task representation of vtask.

ValueTask.toUnit vtask

Full Usage: ValueTask.toUnit vtask

Parameters:
    vtask : ValueTask<'T> - The ValueTask whose result should be discarded.

Returns: ValueTask A non-generic ValueTask that completes when vtask completes.
Modifiers: inline
Type parameters: 'T

Converts a ValueTask to its non-generic counterpart.

vtask : ValueTask<'T>

The ValueTask whose result should be discarded.

Returns: ValueTask

A non-generic ValueTask that completes when vtask completes.

ValueTask.zip left right

Full Usage: ValueTask.zip left right

Parameters:
Returns: ValueTask<'left * 'right> A tuple of the parameters passed in
Modifiers: inline
Type parameters: 'left, 'right

Takes two PoolingValueTasks, starts them serially in order of left to right, and returns a tuple of the pair.

left : ValueTask<'left>

The left value.

right : ValueTask<'right>

The right value.

Returns: ValueTask<'left * 'right>

A tuple of the parameters passed in

Type something to start searching.