Expand description
By-reference traversal of bifunctor structures.
§Examples
use fp_library::{
brands::*,
functions::explicit::*,
};
let x: Result<i32, i32> = Ok(5);
let y = bi_traverse::<RcFnBrand, ResultBrand, _, _, _, _, OptionBrand, _, _>(
(|e: &i32| Some(e + 1), |s: &i32| Some(s * 2)),
&x,
);
assert_eq!(y, Some(Ok(10)));Traits§
- RefBitraversable
- A type class for data structures with two type arguments that can be traversed by reference.
Functions§
- ref_
bi_ for - Traverses the bitraversable structure by reference with arguments flipped.
- ref_
bi_ for_ left - Traverses only the first-position elements by reference with arguments flipped.
- ref_
bi_ for_ right - Traverses only the second-position elements by reference with arguments flipped.
- ref_
bi_ sequence - Sequences a bitraversable structure containing applicative values by reference.
- ref_
bi_ traverse - Traverses a bitraversable structure by reference with two effectful functions.
- ref_
bi_ traverse_ left - Traverses only the first-position elements by reference, lifting second-position elements via
pure. - ref_
bi_ traverse_ right - Traverses only the second-position elements by reference, lifting first-position elements via
pure.