pub enum Term {
BoundVar(usize),
FreeVar(String),
Abs(Box<Term>, Hint),
App(Box<Term>, Box<Term>),
Lit(Lit),
Prim(String, Vec<Term>),
}Variants§
BoundVar(usize)
FreeVar(String)
Abs(Box<Term>, Hint)
App(Box<Term>, Box<Term>)
Lit(Lit)
Prim(String, Vec<Term>)
Implementations§
Source§impl Term
impl Term
pub fn free(name: impl Into<String>) -> Term
pub fn abs(body: Term, hint: impl Into<String>) -> Term
pub fn app(func: Term, arg: Term) -> Term
pub fn prim(name: impl Into<String>, args: Vec<Term>) -> Term
pub fn children(&self) -> Vec<&Term>
Sourcepub fn map_children(&self, f: impl FnMut(&Term) -> Term) -> Term
pub fn map_children(&self, f: impl FnMut(&Term) -> Term) -> Term
This term with every child replaced by f(child), in children order.
Sourcepub fn replace_child(&self, position: usize, replacement: Term) -> Term
pub fn replace_child(&self, position: usize, replacement: Term) -> Term
This term with child position replaced by replacement.
Trait Implementations§
impl Eq for Term
impl StructuralPartialEq for Term
Auto Trait Implementations§
impl Forget for Term
impl Freeze for Term
impl Move for Term
impl RefUnwindSafe for Term
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnsafeUnpin for Term
impl UnwindSafe for Term
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.