pub fn send_defer<'a, D, F>(f: F) -> DExpand description
Creates a deferred value from a thread-safe thunk.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall d. SendDeferrable d => (() -> d) -> d
§Type Parameters
'a: The lifetime of the computationD: The type of the deferred value.F: The type of the thunk.
§Parameters
f: The function that produces the value.
§Returns
A deferred value.
§Examples
use fp_library::{brands::*, functions::*, types::*};
let memo: ArcLazy<i32> = send_defer(|| ArcLazy::new(|| 42));
assert_eq!(*memo.evaluate(), 42);