pub struct Rec<P> {
pub unsafe_pattern: P,
}Expand description
Recursively bind a pattern in itself
Mutually recursive bindings can be modelled by combining this type with
the pattern implementations for Vec<P> and (P1, P2).
Fields§
§unsafe_pattern: PImplementations§
Trait Implementations§
Source§impl<N, P> BoundPattern<N> for Rec<P>
impl<N, P> BoundPattern<N> for Rec<P>
Source§fn pattern_eq(&self, other: &Rec<P>) -> bool
fn pattern_eq(&self, other: &Rec<P>) -> bool
Alpha equivalence for patterns
Source§fn 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
Source§fn 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
Source§fn 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 turnSource§fn 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 turnSource§fn 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 turnSource§fn 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 turnimpl<P: Eq> Eq for Rec<P>
impl<P> StructuralPartialEq for Rec<P>
Auto Trait Implementations§
impl<P> Freeze for Rec<P>where
P: Freeze,
impl<P> RefUnwindSafe for Rec<P>where
P: RefUnwindSafe,
impl<P> Send for Rec<P>where
P: Send,
impl<P> Sync for Rec<P>where
P: Sync,
impl<P> Unpin for Rec<P>where
P: Unpin,
impl<P> UnwindSafe for Rec<P>where
P: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more