Optic

Struct Optic 

Source
pub struct Optic<F: Functor<K, O1, A1, O2, A2>, R: Functor<K, O1, A1, O2, A2>, K: ArrayKind, O1, A1, O2, A2> {
    pub fwd: F,
    pub rev: R,
    pub residual: Box<dyn Fn(&Operations<K, O1, A1>) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>>,
    /* private fields */
}
Expand description

An optic is composed of forward and reverse functors along with a residual object

Fields§

§fwd: F§rev: R§residual: Box<dyn Fn(&Operations<K, O1, A1>) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>>

Implementations§

Source§

impl<F: Functor<K, O1, A1, O2, A2>, R: Functor<K, O1, A1, O2, A2>, K: ArrayKind, O1, A1, O2, A2> Optic<F, R, K, O1, A1, O2, A2>

Source

pub fn new( fwd: F, rev: R, residual: Box<dyn Fn(&Operations<K, O1, A1>) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>>, ) -> Optic<F, R, K, O1, A1, O2, A2>

Source§

impl<F, R, K: ArrayKind + Debug, O1, A1, O2, A2> Optic<F, R, K, O1, A1, O2, A2>
where F: Functor<K, O1, A1, O2, A2>, R: Functor<K, O1, A1, O2, A2>, K::Type<K::I>: NaturalArray<K>, K::Type<O1>: Array<K, O1> + PartialEq, K::Type<A1>: Array<K, A1>, K::Type<O2>: Array<K, O2> + PartialEq + Debug, K::Type<A2>: Array<K, A2>,

Source

pub fn adapt( &self, c: &OpenHypergraph<K, O2, A2>, a: &SemifiniteFunction<K, O1>, b: &SemifiniteFunction<K, O1>, ) -> OpenHypergraph<K, O2, A2>

Trait Implementations§

Source§

impl<F, R, K: ArrayKind + Debug, O1, A1, O2, A2> Functor<K, O1, A1, O2, A2> for Optic<F, R, K, O1, A1, O2, A2>
where F: Functor<K, O1, A1, O2, A2>, R: Functor<K, O1, A1, O2, A2>, K::Type<K::I>: NaturalArray<K>, K::Type<O1>: Array<K, O1> + PartialEq, K::Type<A1>: Array<K, A1>, K::Type<O2>: Array<K, O2> + PartialEq + Debug, K::Type<A2>: Array<K, A2>,

Source§

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

Action on objects
Source§

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

Action on tensoring of operations, i.e., compute F(f₀) ● F(f₁) ● .. ● F(fn) for generators f_i.
Source§

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

Action on arrows. If you have implemented map_operations, you can implement this simply as define_map_arrow(self, f).

Auto Trait Implementations§

§

impl<F, R, K, O1, A1, O2, A2> Freeze for Optic<F, R, K, O1, A1, O2, A2>
where F: Freeze, R: Freeze,

§

impl<F, R, K, O1, A1, O2, A2> !RefUnwindSafe for Optic<F, R, K, O1, A1, O2, A2>

§

impl<F, R, K, O1, A1, O2, A2> !Send for Optic<F, R, K, O1, A1, O2, A2>

§

impl<F, R, K, O1, A1, O2, A2> !Sync for Optic<F, R, K, O1, A1, O2, A2>

§

impl<F, R, K, O1, A1, O2, A2> Unpin for Optic<F, R, K, O1, A1, O2, A2>
where F: Unpin, R: Unpin, A2: Unpin,

§

impl<F, R, K, O1, A1, O2, A2> !UnwindSafe for Optic<F, R, K, O1, A1, O2, A2>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.