Enum moniker::Var [−][src]
pub enum Var<N> { Free(FreeVar<N>), Bound(ScopeOffset, BinderIndex, Option<N>), }
A variable that can either be free or bound
Variants
Free(FreeVar<N>)
A free variable
Bound(ScopeOffset, BinderIndex, Option<N>)
A variable that is bound by a lambda or pi binder
Methods
impl<N> Var<N>
[src]
impl<N> Var<N>
Trait Implementations
impl<N: PartialEq + Clone> BoundTerm<N> for Var<N>
[src]
impl<N: PartialEq + Clone> BoundTerm<N> for Var<N>
fn term_eq(&self, other: &Var<N>) -> bool
[src]
fn term_eq(&self, other: &Var<N>) -> bool
Alpha equivalence in a term context
fn close_term(
&mut self,
state: ScopeState,
pattern: &impl BoundPattern<N>
)
[src]
fn close_term(
&mut self,
state: ScopeState,
pattern: &impl BoundPattern<N>
)
fn open_term(
&mut self,
state: ScopeState,
pattern: &impl BoundPattern<N>
)
[src]
fn open_term(
&mut self,
state: ScopeState,
pattern: &impl BoundPattern<N>
)
fn visit_vars(
&self,
on_var: &mut impl FnMut(&Var<N>)
)
[src]
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>)
)
[src]
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,
[src]
fn free_vars(&self) -> HashSet<FreeVar<N>> where
N: Eq + Hash + Clone,
Returns the set of free variables in this term
impl<N: Debug> Debug for Var<N>
[src]
impl<N: Debug> Debug for Var<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N: Clone> Clone for Var<N>
[src]
impl<N: Clone> Clone for Var<N>
fn clone(&self) -> Var<N>
[src]
fn clone(&self) -> Var<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<N> PartialEq for Var<N> where
N: PartialEq,
[src]
impl<N> PartialEq for Var<N> where
N: PartialEq,
fn eq(&self, other: &Var<N>) -> bool
[src]
fn eq(&self, other: &Var<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<N> Eq for Var<N> where
N: Eq,
[src]
impl<N> Eq for Var<N> where
N: Eq,
impl<N> Hash for Var<N> where
N: Hash,
[src]
impl<N> Hash for Var<N> where
N: Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<N: Display> Display for Var<N>
[src]
impl<N: Display> Display for Var<N>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<N> PartialEq<Binder<N>> for Var<N> where
N: PartialEq,
[src]
impl<N> PartialEq<Binder<N>> for Var<N> where
N: PartialEq,
fn eq(&self, other: &Binder<N>) -> bool
[src]
fn eq(&self, other: &Binder<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<N> PartialEq<FreeVar<N>> for Var<N> where
N: PartialEq,
[src]
impl<N> PartialEq<FreeVar<N>> for Var<N> where
N: PartialEq,
fn eq(&self, other: &FreeVar<N>) -> bool
[src]
fn eq(&self, other: &FreeVar<N>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<N> PartialEq<Var<N>> for Binder<N> where
N: PartialEq,
[src]
impl<N> PartialEq<Var<N>> for Binder<N> where
N: PartialEq,