Expand description
Data structures with two type arguments that can be folded into a single value.
§Examples
use fp_library::{
brands::*,
functions::explicit::*,
};
let x: Result<i32, i32> = Ok(5);
let y = bi_fold_map::<RcFnBrand, ResultBrand, _, _, _, _, _>(
(|e: i32| e.to_string(), |s: i32| s.to_string()),
x,
);
assert_eq!(y, "5".to_string());Traits§
- Bifoldable
- A type class for data structures with two type arguments that can be folded.
Functions§
- bi_
fold_ left - Folds the bifoldable structure from left to right using two step functions.
- bi_
fold_ map - Maps elements of both types to a monoid and combines the results.
- bi_
fold_ right - Folds the bifoldable structure from right to left using two step functions.