[][src]Trait free_algebra::monoid::MonoidRule

pub trait MonoidRule<C> {
    fn apply(word: Vec<C>, letter: C) -> Vec<C>;

    fn apply_many(word1: Vec<C>, word2: Vec<C>) -> Vec<C> { ... }
fn apply_iter<I: Iterator<Item = C>>(word: Vec<C>, letters: I) -> Vec<C> { ... } }

Dictates a rule for how to multiply or add letters to a MonoidalString's word

The simplest possible version of this simply applies multiplication as simple concatenation, but this trait is robust enough to support more complex operations such as for FreeGroup

Required methods

fn apply(word: Vec<C>, letter: C) -> Vec<C>

Applies the operation rule to the product of a word and a single letter

Loading content...

Provided methods

fn apply_many(word1: Vec<C>, word2: Vec<C>) -> Vec<C>

Applies the operation rule to the product of two words

By default, this computes the result by individually applying the rule to each letter of the second word to the first using MonoidRule::apply

fn apply_iter<I: Iterator<Item = C>>(word: Vec<C>, letters: I) -> Vec<C>

Applies the operation rule to the product of a word and a sequence of letters

By default, this computes the result by individually applying the rule to each letter in sequence to the first using MonoidRule::apply

Loading content...

Implementations on Foreign Types

impl<C> MonoidRule<C> for ()[src]

Loading content...

Implementors

impl<C: Eq, P: Add<Output = P>> MonoidRule<FreePow<C, P>> for PowRule[src]

impl<T: Eq> MonoidRule<FreeInv<T>> for InvRule[src]

Loading content...