Skip to main content

Tensor

Trait Tensor 

Source
pub trait Tensor: Arrow {
    // Required method
    fn tensor<A, B, C, D>(
        left: Self::P<A, B>,
        right: Self::P<C, D>,
    ) -> Self::P<(A, C), (B, D)>
       where A: Clone + 'static,
             B: Clone + 'static,
             C: Clone + 'static,
             D: Clone + 'static;

    // Provided methods
    fn associate<A, B, C>() -> Self::P<((A, B), C), (A, (B, C))>
       where A: Clone + 'static,
             B: Clone + 'static,
             C: Clone + 'static { ... }
    fn associate_inv<A, B, C>() -> Self::P<(A, (B, C)), ((A, B), C)>
       where A: Clone + 'static,
             B: Clone + 'static,
             C: Clone + 'static { ... }
    fn left_unitor<A>() -> Self::P<((), A), A>
       where A: Clone + 'static { ... }
    fn left_unitor_inv<A>() -> Self::P<A, ((), A)>
       where A: Clone + 'static { ... }
    fn right_unitor<A>() -> Self::P<(A, ()), A>
       where A: Clone + 'static { ... }
    fn right_unitor_inv<A>() -> Self::P<A, (A, ())>
       where A: Clone + 'static { ... }
}
Expand description

Monoidal structure for categories whose objects can be tensored in parallel.

In this initial encoding, the tensor product is modeled with Rust tuples.

Required Methods§

Source

fn tensor<A, B, C, D>( left: Self::P<A, B>, right: Self::P<C, D>, ) -> Self::P<(A, C), (B, D)>
where A: Clone + 'static, B: Clone + 'static, C: Clone + 'static, D: Clone + 'static,

Tensor two morphisms in parallel.

Provided Methods§

Source

fn associate<A, B, C>() -> Self::P<((A, B), C), (A, (B, C))>
where A: Clone + 'static, B: Clone + 'static, C: Clone + 'static,

The left-associated product ((a, b), c) -> (a, (b, c)).

Source

fn associate_inv<A, B, C>() -> Self::P<(A, (B, C)), ((A, B), C)>
where A: Clone + 'static, B: Clone + 'static, C: Clone + 'static,

The inverse associator (a, (b, c)) -> ((a, b), c).

Source

fn left_unitor<A>() -> Self::P<((), A), A>
where A: Clone + 'static,

Left unitor ((), a) -> a.

Source

fn left_unitor_inv<A>() -> Self::P<A, ((), A)>
where A: Clone + 'static,

Inverse left unitor a -> ((), a).

Source

fn right_unitor<A>() -> Self::P<(A, ()), A>
where A: Clone + 'static,

Right unitor (a, ()) -> a.

Source

fn right_unitor_inv<A>() -> Self::P<A, (A, ())>
where A: Clone + 'static,

Inverse right unitor a -> (a, ()).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Tensor for FnA

Available on crate features alloc or std only.