Trait cp_library_rs::algebraic_structure::monoid::Monoid
source · pub trait Monoid {
type Val: Clone;
// Required methods
fn id() -> Self::Val;
fn op(left: &Self::Val, right: &Self::Val) -> Self::Val;
}
Expand description
モノイド
Monoid::Val
: データの型 $S
$Monoid::id
: 単位元を返す関数 $\varnothing \to S
$Monoid::op
: 演算 $S\times S \to S
$