FSharp.Core


LazyExtensions Module

Extensions related to Lazy values.

Type extensions

Type extension Description

Lazy.Create(creator)

Full Usage: Lazy.Create(creator)

Parameters:
    creator : unit -> 'T - The function to provide the value when needed.

Returns: Lazy<'T> The created Lazy object.

Creates a lazy computation that evaluates to the result of the given function when forced.

Extended Type: Lazy

creator : unit -> 'T

The function to provide the value when needed.

Returns: Lazy<'T>

The created Lazy object.

Lazy.CreateFromValue(value)

Full Usage: Lazy.CreateFromValue(value)

Parameters:
    value : 'T - The input value.

Returns: Lazy<'T> The created Lazy object.

Creates a lazy computation that evaluates to the given value when forced.

Extended Type: Lazy

value : 'T

The input value.

Returns: Lazy<'T>

The created Lazy object.

this.Force()

Full Usage: this.Force()

Parameters:
Returns: 'T The value of the Lazy object.

Forces the execution of this value and return its result. Same as Value. Mutual exclusion is used to prevent other threads also computing the value.

Extended Type: Lazy

() : unit
Returns: 'T

The value of the Lazy object.