pub struct Term {
pub id: TermId,
pub decl_pos: Pos,
pub name: Sym,
pub arg_tys: Vec<TypeId>,
pub ret_ty: TypeId,
pub kind: TermKind,
}Expand description
A term.
Maps parameter types to result types if this is a constructor term, or result types to parameter types if this is an extractor term. Or both if this term can be either a constructor or an extractor.
Fields§
§id: TermIdThis term’s id.
decl_pos: PosThe source position where this term was declared.
name: SymThe name of this term.
arg_tys: Vec<TypeId>The parameter types to this term.
ret_ty: TypeIdThe result types of this term.
kind: TermKindThe kind of this term.
Implementations§
Source§impl Term
impl Term
Sourcepub fn is_enum_variant(&self) -> bool
pub fn is_enum_variant(&self) -> bool
Is this term an enum variant?
Sourcepub fn is_partial(&self) -> bool
pub fn is_partial(&self) -> bool
Is this term partial?
Sourcepub fn is_recursive(&self) -> bool
pub fn is_recursive(&self) -> bool
Is this term marked as recursive?
Sourcepub fn has_constructor(&self) -> bool
pub fn has_constructor(&self) -> bool
Does this term have a constructor?
Sourcepub fn has_extractor(&self) -> bool
pub fn has_extractor(&self) -> bool
Does this term have an extractor?
Sourcepub fn has_external_extractor(&self) -> bool
pub fn has_external_extractor(&self) -> bool
Is this term’s extractor external?
Sourcepub fn has_external_constructor(&self) -> bool
pub fn has_external_constructor(&self) -> bool
Is this term’s constructor external?
Sourcepub fn has_internal_constructor(&self) -> bool
pub fn has_internal_constructor(&self) -> bool
Is this term’s constructor internal?
Sourcepub fn extractor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
pub fn extractor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
Get this term’s extractor’s external function signature, if any.
Sourcepub fn constructor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
pub fn constructor_sig(&self, tyenv: &TypeEnv) -> Option<ExternalSig>
Get this term’s constructor’s external function signature, if any.