pub fn send_ref_apply_first<'a, Brand: SendRefApplyFirst, A: Clone + Send + Sync + 'a, B: Send + Sync + 'a>(
fa: &<Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>,
fb: &<Brand as Kind_cdc7cd43dac7585f>::Of<'a, B>,
) -> <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>Expand description
Combines two thread-safe contexts, keeping the value from the first.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall Brand A B. SendRefApplyFirst Brand => (&Brand A, &Brand B) -> Brand A
§Type Parameters
'a: The lifetime of the values.Brand: The brand of the context.A: The type of the value in the first context. Must beClone + Send + Sync.B: The type of the value in the second context.
§Parameters
fa: The first context.fb: The second context.
§Returns
A new context containing the value from the first context.
§Examples
use fp_library::{
brands::*,
functions::*,
types::*,
};
let x = ArcLazy::new(|| 3);
let y = ArcLazy::new(|| 4);
let result = send_ref_apply_first::<LazyBrand<ArcLazyConfig>, _, _>(&x, &y);
assert_eq!(*result.evaluate(), 3);