Skip to main content

Module ref_apply_first

Module ref_apply_first 

Source
Expand description

Combining two by-ref contexts, keeping the first value, with ref_apply_first.

This is the by-ref counterpart of ApplyFirst.

§Examples

use fp_library::{
	brands::*,
	functions::{
		explicit::apply_first,
		*,
	},
	types::*,
};

let x = RcLazy::pure(3);
let y = RcLazy::pure(4);
let result = apply_first::<LazyBrand<RcLazyConfig>, _, _, _, _>(&x, &y);
assert_eq!(*result.evaluate(), 3);

Traits§

RefApplyFirst
A type class for combining two by-ref contexts, keeping the first value.

Functions§

ref_apply_first
Combines two contexts, keeping the value from the first.