Trait SpiderFunctor

Source
pub trait SpiderFunctor<K: ArrayKind, O1, A1, O2, A2>: Sized
where K::Type<K::I>: NaturalArray<K>, K::Type<O1>: Array<K, O1>, K::Type<A1>: Array<K, A1>, K::Type<O2>: Array<K, O2>, K::Type<A2>: Array<K, A2>,
{ // Required methods fn map_object( a: &SemifiniteFunction<K, O1>, ) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>; fn map_operations(ops: Operations<K, O1, A1>) -> OpenHypergraph<K, O2, A2>; // Provided method fn map_arrow(f: &OpenHypergraph<K, O1, A1>) -> OpenHypergraph<K, O2, A2> { ... } }
Expand description

A SpiderFunctor is a Functor implemented in terms of its action on a tensoring of Operations. This is (generally) easier to implement than Functor directly.

Required Methods§

Source

fn map_object( a: &SemifiniteFunction<K, O1>, ) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>

Action on objects

Source

fn map_operations(ops: Operations<K, O1, A1>) -> OpenHypergraph<K, O2, A2>

Often, it’s easier to map a list of operations f, g, h into their tensoring F(f) ● F(g) ● F(h). This efficiently generalises to the implementation of map_arrow.

Provided Methods§

Source

fn map_arrow(f: &OpenHypergraph<K, O1, A1>) -> OpenHypergraph<K, O2, A2>

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§

Source§

impl<K: ArrayKind, O, A> SpiderFunctor<K, O, A, O, A> for Identity
where K::Type<K::I>: NaturalArray<K>, K::Type<O>: Array<K, O>, K::Type<A>: Array<K, A>,