Trait Monoid

Source
pub trait Monoid {
    type Val: Clone;

    // Required methods
    fn e() -> Self::Val;
    fn op(left: &Self::Val, right: &Self::Val) -> Self::Val;
}
Expand description

モノイド

Required Associated Types§

Source

type Val: Clone

データの型 ($S$)

Required Methods§

Source

fn e() -> Self::Val

単位元 ($\varnothing \to S$)

Source

fn op(left: &Self::Val, right: &Self::Val) -> Self::Val

演算 ($S \times S \to S$)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Monoid for ()

Source§

type Val = ()

Source§

fn e() -> Self::Val

Source§

fn op(_: &Self::Val, _: &Self::Val) -> Self::Val

Implementors§

Source§

impl Monoid for WrappingAdd

Source§

impl Monoid for Xor

Source§

impl<T> Monoid for GCD<T>

Source§

impl<T> Monoid for Affine<T>
where T: Clone + Debug, Affine<T>: AffineTransform<T>,

Source§

impl<T: Ord + Bounded + Clone> Monoid for Indexed<Max<T>>

Source§

type Val = (T, usize)

Source§

impl<T: Ord + Bounded + Clone> Monoid for Indexed<Min<T>>

Source§

type Val = (T, usize)

Source§

impl<T: Ord + Bounded + Clone> Monoid for Max<T>

Source§

type Val = T

Source§

impl<T: Ord + Bounded + Clone> Monoid for Min<T>

Source§

type Val = T

Source§

impl<T: Ord + Bounded + Clone> Monoid for MinMax<T>

Source§

impl<T: One + Clone> Monoid for Mul<T>

Source§

type Val = T

Source§

impl<T: Zero + Clone> Monoid for Add<T>

Source§

type Val = T