[Home] Module Microsoft.FSharp.Control.Lazy


Delayed computations.

Type Definitions

TypeDescription
type t Note: an abbreviation for Lazy<'a>

Exceptions

ExceptionDescription
exception Undefined Note: an abbreviation for = Undefined

Values

ValueDescription
val ( |Lazy| ) : Lazy<'a> -> 'a
val force : Lazy<'a> -> 'a
Force the computation of the given lazy value if not already forced. Raises an exception if the computation raises (or previously raised) an exception. Raises Undefined if executingg the computation recursively forces the evaluation of the computation. Concurrency: This function does not take a lock while forcing execution
val force_val : Lazy<'a> -> 'a
Force the computation of the given lazy value if not already forced. Raises an exception if the computation raises (or previously raised) an exception. Raises Undefined if executingg the computation recursively forces the evaluation of the computation. Concurrency: This function does not take a lock while forcing execution
val force_with_lock : Lazy<'a> -> 'a
Like force, but this function uses the thunks itselfs as a lock while forcing execution If you have multiple threads and your lazy values can be accessed via multiple threads then you should consider using force_with_lock. If you do not the lazy computations may be executed multiple times, and the values produced by some of the computations will be discarded.
val lazy_from_fun : (unit -> 'a) -> Lazy<'a>
Build a lazy (delayed) value from the given computation
val lazy_from_val : 'a -> Lazy<'a>
Build a lazy (delayed) value from the given pre-computed value.
val lazy_is_val : Lazy<'a> -> bool
Check if a lazy (delayed) value has already been computed

Deprecated Values

ValueDescription
[<Obsolete
  ("This value is obsolete: lazy initialization now always uses mutual exclusion when multiple threads force evaluation of the same lazy thunk")>]
val force_without_lock : Lazy<'a> -> 'a

Note: This value is obsolete: lazy initialization now always uses mutual exclusion when multiple threads force evaluation of the same lazy thunk

Equivalent to force

See Also

Microsoft.FSharp.Control


Documentation for assembly FSharp.Core, version 1.9.4.19, generated using F# version 1.9.4.19