pub fn apply_second<'a, Brand: ApplySecond, B: 'a + Clone, A: 'a + Clone>(
fa: <Brand as Kind_cdc7cd43dac7585f>::Of<'a, A>,
fb: <Brand as Kind_cdc7cd43dac7585f>::Of<'a, B>,
) -> <Brand as Kind_cdc7cd43dac7585f>::Of<'a, B>Expand description
Combines two contexts, keeping the value from the second context.
Free function version that dispatches to the type class’ associated function.
§Type Signature
forall a b. ApplySecond f => (f a, f b) -> f b
§Type Parameters
Brand: The brand of the context.B: The type of the value in the second context.A: The type of the value in the first context.
§Parameters
fa: The first context.fb: The second context.
§Returns
The second context.
§Examples
use fp_library::{brands::*, functions::*};
let x = Some(5);
let y = Some(10);
let z = apply_second::<OptionBrand, _, _>(x, y);
assert_eq!(z, Some(10));