pub enum Term<'a> {
Show 20 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 {
items: &'a [TermId],
tail: Option<TermId>,
},
ListType {
item_type: TermId,
},
Str(&'a str),
StrType,
Nat(u64),
NatType,
ExtSet {
extensions: &'a [&'a str],
rest: Option<TermId>,
},
ExtSetType,
Adt {
variants: TermId,
},
FuncType {
inputs: TermId,
outputs: TermId,
extensions: TermId,
},
Control {
values: TermId,
},
ControlType,
}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, with an optional tail.
[ITEM-0 ... ITEM-n] : (list T)whereT : static,ITEM-i : T.[ITEM-0 ... ITEM-n . TAIL] : (list item-type)whereT : static,ITEM-i : T,TAIL : (list T).
Fields
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.
(ext EXT-0 ... EXT-n) : ext-set(ext EXT-0 ... EXT-n . REST) : ext-setwhereREST : ext-set.
Fields
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: TermIdThe 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
Trait Implementations§
impl<'a> Eq for Term<'a>
impl<'a> StructuralPartialEq for Term<'a>
Auto Trait Implementations§
impl<'a> Freeze for Term<'a>
impl<'a> RefUnwindSafe for Term<'a>
impl<'a> Send for Term<'a>
impl<'a> Sync for Term<'a>
impl<'a> Unpin for Term<'a>
impl<'a> UnwindSafe for Term<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)