notebook_types/v0/
theory.rs

1use serde::{Deserialize, Serialize};
2use tsify::Tsify;
3
4use ustr::Ustr;
5
6/// Object type in a double theory.
7#[derive(Clone, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, Tsify)]
8#[serde(tag = "tag", content = "content")]
9#[tsify(into_wasm_abi, from_wasm_abi)]
10pub enum ObType {
11    /// Basic or generating object type.
12    Basic(Ustr),
13
14    /// Tabulator of a morphism type.
15    Tabulator(Box<MorType>),
16}
17
18/// Morphism type in a double theory.
19#[derive(Clone, PartialEq, Eq, Hash, Debug, Serialize, Deserialize, Tsify)]
20#[serde(tag = "tag", content = "content")]
21#[tsify(into_wasm_abi, from_wasm_abi)]
22pub enum MorType {
23    /// Basic or generating morphism type.
24    Basic(Ustr),
25
26    /// Hom type on an object type.
27    Hom(Box<ObType>),
28}