pub trait Semilattice {
    type Val: Clone;

    // Required methods
    fn id() -> Self::Val;
    fn op(x: &Self::Val, y: &Self::Val) -> Self::Val;
}
Expand description

半束

  • 単位元をもち,可環かつ冪等な2項演算

Required Associated Types§

source

type Val: Clone

元の型

Required Methods§

source

fn id() -> Self::Val

単位元

source

fn op(x: &Self::Val, y: &Self::Val) -> Self::Val

可換かつ冪等な二項演算

Implementors§

source§

impl<T: Zero + Rem<T>> Semilattice for GCD<T>

§

type Val = usize

source§

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

§

type Val = T

source§

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

§

type Val = T