Expand description
Parallel by-reference foldable.
User story: “I want to fold over a collection by reference in parallel.”
§Examples
use fp_library::{
brands::VecBrand,
classes::par_ref_foldable::ParRefFoldable,
};
let v = vec![1, 2, 3];
let result = VecBrand::par_ref_fold_map(|x: &i32| x.to_string(), &v);
assert_eq!(result, "123");Traits§
- ParRef
Foldable - Parallel by-reference folding over a structure.
Functions§
- par_
ref_ fold_ map - Maps each element by reference to a monoid and combines them in parallel.