Skip to main content

Module apply_first

Module apply_first 

Source
Expand description

Sequencing of two computations while keeping the result of the first.

§Examples

use fp_library::{brands::*, functions::*};

let x = Some(5);
let y = Some(10);
let z = apply_first::<OptionBrand, _, _>(x, y);
assert_eq!(z, Some(5));

Traits§

ApplyFirst
A type class for types that support combining two contexts, keeping the first value.

Functions§

apply_first
Combines two contexts, keeping the value from the first context.