pub trait Hom<M: Monoid>: HomMut<M> {
// Required method
fn call(&self, m: M) -> Self::Output;
}Expand description
An Fn-like monoid homomorphism (see the module-level documentation for details).
Required Methods§
Trait Implementations§
Source§impl<'a, M: 'a + Monoid> Monoid for Box<dyn Hom<M, Output = M> + 'a>
Monoid endomorphisms (homomorphisms where Output = Input) are themselves monoids under composition.
impl<'a, M: 'a + Monoid> Monoid for Box<dyn Hom<M, Output = M> + 'a>
Monoid endomorphisms (homomorphisms where Output = Input) are themselves monoids under composition.
Source§fn combine(self, rhs: Self) -> Self
fn combine(self, rhs: Self) -> Self
Combine an element with another element.
This must obey Read more
Source§fn combine_assign(&mut self, rhs: Self)
fn combine_assign(&mut self, rhs: Self)
Source§fn combine_assign_to(self, rhs: &mut Self)
fn combine_assign_to(self, rhs: &mut Self)
Source§fn combine_iter<I: Iterator<Item = Self>>(iter: I) -> Self
fn combine_iter<I: Iterator<Item = Self>>(iter: I) -> Self
An overridable method to provide some optimization based on the fact that
combine is associative.Source§fn combine_iter_assign<I: Iterator<Item = Self>>(&mut self, iter: I)
fn combine_iter_assign<I: Iterator<Item = Self>>(&mut self, iter: I)
Like
combine_iter, but assigns the result to self.Implementations on Foreign Types§
Source§impl<M1: Monoid, M2: Monoid, H1, H2> Hom<(M1, M2)> for (H1, H2)
See HomOnce for (H1, H2) for an explanation.
impl<M1: Monoid, M2: Monoid, H1, H2> Hom<(M1, M2)> for (H1, H2)
See HomOnce for (H1, H2) for an explanation.
Source§impl<M: Monoid> Hom<M> for ()
While this is a bit of an abuse of typing,
the unit type here stands for the monoid homomorphism that
just maps everything to the only possible output value.
impl<M: Monoid> Hom<M> for ()
While this is a bit of an abuse of typing, the unit type here stands for the monoid homomorphism that just maps everything to the only possible output value.
(See also: Terminal object (wiki))