pub trait Arrow: Sized {
type Object;
fn source(&self) -> Self::Object;
fn target(&self) -> Self::Object;
fn identity(a: Self::Object) -> Self;
fn compose(&self, other: &Self) -> Option<Self>;
}
pub trait Coproduct: Arrow {
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>;
}
pub trait Monoidal: Arrow {
fn unit() -> Self::Object;
fn tensor(&self, other: &Self) -> Self;
}
pub trait SymmetricMonoidal: Monoidal {
fn twist(a: Self::Object, b: Self::Object) -> Self;
}