Expand description
Thread-safe by-ref monadic sequencing with send_ref_bind.
Like RefSemimonad::ref_bind, but
the continuation must be Send and element types must be Send + Sync.
§Examples
use fp_library::{
brands::*,
classes::*,
functions::*,
types::*,
};
let lazy = ArcLazy::new(|| 5);
let result = send_ref_bind::<LazyBrand<ArcLazyConfig>, _, _>(&lazy, |x: &i32| {
let v = *x * 2;
ArcLazy::new(move || v)
});
assert_eq!(*result.evaluate(), 10);Traits§
- Send
RefSemimonad - A type class for thread-safe monadic sequencing via references.
Functions§
- send_
ref_ bind - Sequences a thread-safe computation using a reference to the value.