Trait ArqSpec

Source
pub trait ArqSpec {
    type S: Clone;
    type F: Clone;

    // Required methods
    fn op(a: &Self::S, b: &Self::S) -> Self::S;
    fn identity() -> Self::S;
    fn compose(f: &Self::F, g: &Self::F) -> Self::F;
    fn apply(f: &Self::F, a: &Self::S, size: i64) -> Self::S;
}

Required Associated Types§

Source

type S: Clone

Type of underlying array elements.

Source

type F: Clone

Type of data representing an endomorphism.

Required Methods§

Source

fn op(a: &Self::S, b: &Self::S) -> Self::S

Must satisfy the Associative Law: For all a,b,c, op(a, op(b, c)) = op(op(a, b), c)

Source

fn identity() -> Self::S

Must satisfy the Identity Law: For all a, op(a, identity()) = op(identity(), a) = a

Source

fn compose(f: &Self::F, g: &Self::F) -> Self::F

Must satisfy the Composition Law: For all f,g,a, apply(compose(f, g), a) = apply(f, apply(g, a))

Source

fn apply(f: &Self::F, a: &Self::S, size: i64) -> Self::S

Must satisfy the Distributive Law: For all f,a,b, apply(f, op(a, b), s+t) = op(apply(f, a, s), apply(f, b, t)) The size parameter makes this law easier to satisfy in certain cases.

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.

Implementors§