pub trait BoundTerm<N: Clone + PartialEq> {
fn term_eq(&self, other: &Self) -> bool;
fn close_term(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>);
fn open_term(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>);
fn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>));
fn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>));
fn free_vars(&self) -> HashSet<FreeVar<N>>
where
N: Eq + Hash + Clone,
{ ... }
}
Expand description
Terms that may contain variables that can be bound by patterns
Required Methods
sourcefn close_term(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
fn close_term(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
Close the term using the supplied binders
sourcefn open_term(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
fn open_term(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
Open the term using the supplied binders
sourcefn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>))
fn visit_vars(&self, on_var: &mut impl FnMut(&Var<N>))
Visit each variable in the term, calling the on_var
callback on each
of them in turn
sourcefn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>))
fn visit_mut_vars(&mut self, on_var: &mut impl FnMut(&mut Var<N>))
Visit each variable in the term, calling the on_var
callback on each
of them in turn