pub enum Ty {
Var(TyVarId),
Con(Arc<str>, Vec<Ty>),
Fun(Vec<Ty>, Box<Ty>, Row),
}Variants§
Var(TyVarId)
Con(Arc<str>, Vec<Ty>)
A named type constructor applied to arguments: Int, list[T], Map[K,V], Signal[T],
secret[T], and every user model/union/newtype.
Fun(Vec<Ty>, Box<Ty>, Row)
A function, with the effect row it performs when applied. §3.2’s (A) -> B ! e.
Implementations§
Source§impl Ty
impl Ty
pub const INT: &'static str = "Int"
pub const STR: &'static str = "Str"
pub const BOOL: &'static str = "Bool"
pub const FLOAT: &'static str = "Float"
pub const UNIT: &'static str = "Unit"
pub const HTML: &'static str = "Html"
pub const ATTR: &'static str = "Attr"
pub const LIST: &'static str = "list"
pub const MAP: &'static str = "Map"
pub const OPTION: &'static str = "Option"
pub const RESULT: &'static str = "Result"
pub const STREAM: &'static str = "Stream"
pub const SIGNAL: &'static str = "Signal"
pub const ENVELOPE: &'static str = "Envelope"
Sourcepub const SECRET: &'static str = "secret"
pub const SECRET: &'static str = "secret"
§3.5: “secret[T] is not Sendable”. The one type constructor whose whole purpose is to fail
a boundary check.
Sourcepub const INTERNAL: &'static str = "internal"
pub const INTERNAL: &'static str = "internal"
The other half of that story, and the quadrant secret[T] alone leaves empty: may be
written to the log, may never cross a boundary.
An event-sourced system has to record what happened, including facts a client must never
see — why an account was suspended, which rule fired, what an upstream vendor called the
customer. secret[T] cannot express that, because a secret is also not storable (§3.7’s
F5: tokens must never be persisted into an immutable log). Without internal[T] the choice
is between dropping the fact from the audit trail and trusting that no view ever renders it,
and “trusting” is the word this language exists to delete.
pub fn con(name: &str) -> Ty
pub fn app(name: &str, args: Vec<Ty>) -> Ty
Sourcepub fn fun(params: Vec<Ty>, ret: Ty) -> Ty
pub fn fun(params: Vec<Ty>, ret: Ty) -> Ty
A pure function — the common case, and the one worth being short.