pub enum Term<'a> {
Show 21 variants
Wildcard,
Type,
StaticType,
Constraint,
Var(LocalRef<'a>),
Apply {
global: GlobalRef<'a>,
args: &'a [TermId],
},
ApplyFull {
global: GlobalRef<'a>,
args: &'a [TermId],
},
Quote {
type: TermId,
},
List {
parts: &'a [ListPart],
},
ListType {
item_type: TermId,
},
Str(&'a str),
StrType,
Nat(u64),
NatType,
ExtSet {
parts: &'a [ExtSetPart<'a>],
},
ExtSetType,
Adt {
variants: TermId,
},
FuncType {
inputs: TermId,
outputs: TermId,
extensions: TermId,
},
Control {
values: TermId,
},
ControlType,
NonLinearConstraint {
term: TermId,
},
}
Expand description
A term in the compile time meta language.
Variants§
Wildcard
Standin for any term.
Type
The type of runtime types.
type : static
StaticType
The type of static types.
static : static
Constraint
The type of constraints.
constraint : static
Var(LocalRef<'a>)
A local variable.
Apply
A symbolic function application.
The arguments of this application cover only the explicit parameters of the referenced declaration,
leaving out the implicit parameters. Once the type of the declaration is known, the implicit parameters
can be inferred and the term replaced with Term::ApplyFull
.
(GLOBAL ARG-0 ... ARG-n)
Fields
ApplyFull
A symbolic function application with all arguments applied.
The arguments to this application cover both the implicit and explicit parameters of the referenced declaration.
Since this can be tedious to write out, only the explicit parameters can be provided via Term::Apply
.
(@GLOBAL ARG-0 ... ARG-n)
Fields
Quote
Quote a runtime type as a static type.
(quote T) : static
where T : type
.
List
A list. May include individual items or other lists to be spliced in.
ListType
The type of lists, given a type for the items.
(list T) : static
where T : static
.
Str(&'a str)
A literal string.
"STRING" : str
StrType
The type of literal strings.
str : static
Nat(u64)
A literal natural number.
N : nat
NatType
The type of literal natural numbers.
nat : static
ExtSet
Extension set.
Fields
parts: &'a [ExtSetPart<'a>]
The parts of the extension set.
Since extension sets are unordered, the parts may occur in any order.
ExtSetType
The type of extension sets.
ext-set : static
Adt
An algebraic data type.
(adt VARIANTS) : type
where VARIANTS : (list (list type))
.
Fields
FuncType
The type of functions, given lists of input and output types and an extension set.
Fields
inputs: TermId
The input types of the function, given as a list of runtime types.
inputs : (list type)
Control
Control flow.
(ctrl VALUES) : ctrl
where VALUES : (list type)
.
ControlType
Type of control flow edges.
ctrl : static
NonLinearConstraint
Constraint that requires a runtime type to be copyable and discardable.