Coproduct

Trait Coproduct 

Source
pub trait Coproduct: Arrow {
    // Required methods
    fn initial_object() -> Self::Object;
    fn initial(a: Self::Object) -> Self;
    fn inj0(a: Self::Object, b: Self::Object) -> Self;
    fn inj1(a: Self::Object, b: Self::Object) -> Self;
    fn coproduct(&self, other: &Self) -> Option<Self>;
}

Required Methods§

Source

fn initial_object() -> Self::Object

Source

fn initial(a: Self::Object) -> Self

Construct the initial arrow initial_a : 0 → a from some object a

Source

fn inj0(a: Self::Object, b: Self::Object) -> Self

Source

fn inj1(a: Self::Object, b: Self::Object) -> Self

Source

fn coproduct(&self, other: &Self) -> Option<Self>

Construct the coproduct of two arrows, or None if they didn’t share a codomain.

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> Coproduct for FiniteFunction<K>

Source§

impl<K: ArrayKind, T> Coproduct for SemifiniteArrow<K, T>
where K::Type<T>: Array<K, T>,