Types
Records hold named fields, newline-separated. Sum types hold case variants. A field or a variant payload can carry its own refinement.
public type Phase {
case red
case green
case yellow(seconds_remaining: i32
where seconds_remaining >= 0)
}public type IntStack {
capacity: usize
len: usize where len <= capacity
data: [i64] where data.len() == capacity
}Construction qualifies the variant (Phase.red); inside a match the dot-prefixed form is the pattern. A type that refers to itself goes through Box(T). There is no null; an absent value is Option(T).