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>
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>
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>
impl<F, R, K: ArrayKind + Debug, O1, A1, O2, A2> Optic<F, R, K, O1, A1, O2, A2>
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>
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>
Source§fn map_object(
&self,
a: &SemifiniteFunction<K, O1>,
) -> IndexedCoproduct<K, SemifiniteFunction<K, O2>>
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>
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>
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>
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>
impl<F, R, K, O1, A1, O2, A2> !UnwindSafe for Optic<F, R, K, O1, A1, O2, A2>
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