pub struct Identity;
Expand description
The identity functor, which implements Functor
for any signature.
Trait Implementations§
Source§impl<K: ArrayKind, O, A> Functor<K, O, A, O, A> for Identity
impl<K: ArrayKind, O, A> Functor<K, O, A, O, A> for Identity
Source§fn map_object(
a: &SemifiniteFunction<K, O>,
) -> IndexedCoproduct<K, SemifiniteFunction<K, O>>
fn map_object( a: &SemifiniteFunction<K, O>, ) -> IndexedCoproduct<K, SemifiniteFunction<K, O>>
Action on objects
Source§fn map_arrow(f: &OpenHypergraph<K, O, A>) -> OpenHypergraph<K, O, A>
fn map_arrow(f: &OpenHypergraph<K, O, A>) -> OpenHypergraph<K, O, A>
Action on arrows
Source§impl<K: ArrayKind, O, A> SpiderFunctor<K, O, A, O, A> for Identity
impl<K: ArrayKind, O, A> SpiderFunctor<K, O, A, O, A> for Identity
Source§fn map_object(
a: &SemifiniteFunction<K, O>,
) -> IndexedCoproduct<K, SemifiniteFunction<K, O>>
fn map_object( a: &SemifiniteFunction<K, O>, ) -> IndexedCoproduct<K, SemifiniteFunction<K, O>>
Action on objects
Source§fn map_operations(ops: Operations<K, O, A>) -> OpenHypergraph<K, O, A>
fn map_operations(ops: Operations<K, O, A>) -> OpenHypergraph<K, O, A>
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.
fn map_arrow(f: &OpenHypergraph<K, O1, A1>) -> OpenHypergraph<K, O2, A2>
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more