pub struct StepBrand;Expand description
Brand for Step.
Trait Implementations§
Source§impl Bifunctor for StepBrand
impl Bifunctor for StepBrand
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 step.
This method applies one function to the loop value and another to the done value.
§Type Signature
forall self a b c d. Bifunctor self => (a -> b, c -> d, self a c) -> self b d
§Type Parameters
'a: The lifetime of the values.A: The type of the loop value.B: The type of the mapped loop value.C: The type of the done value.D: The type of the mapped done value.F: The type of the function to apply to the loop value.G: The type of the function to apply to the done value.
§Parameters
f: The function to apply to the loop value.g: The function to apply to the done value.p: The step to map over.
§Returns
A new step containing the mapped values.
§Examples
use fp_library::{brands::*, classes::bifunctor::*, functions::*, types::*};
let x = Step::Loop(1);
assert_eq!(bimap::<StepBrand, _, _, _, _, _, _>(|a| a + 1, |b: i32| b * 2, x), Step::Loop(2));Source§impl Kind_266801a817966495 for StepBrand
Generated implementation of Kind_266801a817966495 for StepBrand.
impl Kind_266801a817966495 for StepBrand
Generated implementation of Kind_266801a817966495 for StepBrand.
Source§impl Kind_5b1bcedfd80bdc16 for StepBrand
Generated implementation of Kind_5b1bcedfd80bdc16 for StepBrand.
impl Kind_5b1bcedfd80bdc16 for StepBrand
Generated implementation of Kind_5b1bcedfd80bdc16 for StepBrand.
Source§impl Ord for StepBrand
impl Ord for StepBrand
Source§impl PartialOrd for StepBrand
impl PartialOrd for StepBrand
impl Copy for StepBrand
impl Eq for StepBrand
impl StructuralPartialEq for StepBrand
Auto Trait Implementations§
impl Freeze for StepBrand
impl RefUnwindSafe for StepBrand
impl Send for StepBrand
impl Sync for StepBrand
impl Unpin for StepBrand
impl UnwindSafe for StepBrand
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