Value | Description |
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
|