pub struct Tuple2Brand;Expand description
Brand for (First, Second), with neither First nor Second filled in.
Trait Implementations§
Source§impl Bifunctor for Tuple2Brand
impl Bifunctor for Tuple2Brand
Source§fn bimap<'a, A: 'a, B: 'a, C: 'a, D: 'a, F, G>(
f: F,
g: G,
p: <Self as Kind_266801a817966495>::Of<'a, A, C>,
) -> <Self as Kind_266801a817966495>::Of<'a, B, D>
fn bimap<'a, A: 'a, B: 'a, C: 'a, D: 'a, F, G>( f: F, g: G, p: <Self as Kind_266801a817966495>::Of<'a, A, C>, ) -> <Self as Kind_266801a817966495>::Of<'a, B, D>
Maps functions over the values in the tuple.
This method applies one function to the first value and another to the second value.
§Type Signature
forall A B C D. (A -> B, C -> D, Tuple2 A C) -> Tuple2 B D
§Type Parameters
'a: The lifetime of the values.A: The type of the first value.B: The type of the mapped first value.C: The type of the second value.D: The type of the mapped second value.F: The type of the function to apply to the first value.G: The type of the function to apply to the second value.
§Parameters
f: The function to apply to the first value.g: The function to apply to the second value.p: The tuple to map over.
§Returns
A new tuple containing the mapped values.
§Examples
use fp_library::{brands::*, classes::bifunctor::*, functions::*};
let x = (1, 5);
assert_eq!(bimap::<Tuple2Brand, _, _, _, _, _, _>(|a| a + 1, |b| b * 2, x), (2, 10));Source§impl Clone for Tuple2Brand
impl Clone for Tuple2Brand
Source§fn clone(&self) -> Tuple2Brand
fn clone(&self) -> Tuple2Brand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Tuple2Brand
impl Debug for Tuple2Brand
Source§impl Default for Tuple2Brand
impl Default for Tuple2Brand
Source§fn default() -> Tuple2Brand
fn default() -> Tuple2Brand
Returns the “default value” for a type. Read more
Source§impl Hash for Tuple2Brand
impl Hash for Tuple2Brand
Source§impl Kind_266801a817966495 for Tuple2Brand
Generated implementation of Kind_266801a817966495 for Tuple2Brand.
impl Kind_266801a817966495 for Tuple2Brand
Generated implementation of Kind_266801a817966495 for Tuple2Brand.
Source§type Of<'a, First: 'a, Second: 'a> = (First, Second)
type Of<'a, First: 'a, Second: 'a> = (First, Second)
The applied type.
Source§impl Kind_5b1bcedfd80bdc16 for Tuple2Brand
Generated implementation of Kind_5b1bcedfd80bdc16 for Tuple2Brand.
impl Kind_5b1bcedfd80bdc16 for Tuple2Brand
Generated implementation of Kind_5b1bcedfd80bdc16 for Tuple2Brand.
Source§type Of<First, Second> = (First, Second)
type Of<First, Second> = (First, Second)
The applied type.
Source§impl Ord for Tuple2Brand
impl Ord for Tuple2Brand
Source§fn cmp(&self, other: &Tuple2Brand) -> Ordering
fn cmp(&self, other: &Tuple2Brand) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for Tuple2Brand
impl PartialEq for Tuple2Brand
Source§impl PartialOrd for Tuple2Brand
impl PartialOrd for Tuple2Brand
impl Copy for Tuple2Brand
impl Eq for Tuple2Brand
impl StructuralPartialEq for Tuple2Brand
Auto Trait Implementations§
impl Freeze for Tuple2Brand
impl RefUnwindSafe for Tuple2Brand
impl Send for Tuple2Brand
impl Sync for Tuple2Brand
impl Unpin for Tuple2Brand
impl UnwindSafe for Tuple2Brand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more