Trait moniker::BoundPattern
source · pub trait BoundPattern<N: Clone + PartialEq> {
fn pattern_eq(&self, other: &Self) -> bool;
fn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>);
fn open_pattern(&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 visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>));
fn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>));
fn free_vars(&self) -> HashSet<FreeVar<N>>
where
N: Eq + Hash + Clone,
{ ... }
fn binders(&self) -> Vec<Binder<N>>
where
N: Clone,
{ ... }
}
Expand description
Patterns that bind variables in terms
Required Methods
sourcefn pattern_eq(&self, other: &Self) -> bool
fn pattern_eq(&self, other: &Self) -> bool
Alpha equivalence for patterns
sourcefn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
fn close_pattern(&mut self, state: ScopeState, on_free: &impl OnFreeFn<N>)
Close the terms in the pattern using the supplied binders
sourcefn open_pattern(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
fn open_pattern(&mut self, state: ScopeState, on_bound: &impl OnBoundFn<N>)
Open the terms in the pattern 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
sourcefn visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>))
fn visit_binders(&self, on_binder: &mut impl FnMut(&Binder<N>))
Visit each of the binders in the term, calling the on_binder
callback
on each of them in turn
sourcefn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>))
fn visit_mut_binders(&mut self, on_binder: &mut impl FnMut(&mut Binder<N>))
Visit each of the binders in the term, calling the on_binder
callback
on each of them in turn