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