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

Alpha equivalence for patterns

Close the terms in the pattern using the supplied binders

Open the terms in the pattern using the supplied binders

Visit each variable in the term, calling the on_var callback on each of them in turn

Visit each variable in the term, calling the on_var callback on each of them in turn

Visit each of the binders in the term, calling the on_binder callback on each of them in turn

Visit each of the binders in the term, calling the on_binder callback on each of them in turn

Provided Methods

Returns the set of free variables in this term

Returns the binders in this pattern

Implementations on Foreign Types

Implementors