pub enum ANFExpr<T> {
Atom(ANFAtom<T>),
Let(VarRef, ANFComputation<T>, Box<ANFExpr<T>>),
}Expand description
ANF expressions
Variants§
Atom(ANFAtom<T>)
Atomic expression (constant or variable)
Let(VarRef, ANFComputation<T>, Box<ANFExpr<T>>)
Let binding: let var = computation in body
Implementations§
Source§impl<T> ANFExpr<T>
impl<T> ANFExpr<T>
Sourcepub fn let_binding(
var_ref: VarRef,
computation: ANFComputation<T>,
body: ANFExpr<T>,
) -> Self
pub fn let_binding( var_ref: VarRef, computation: ANFComputation<T>, body: ANFExpr<T>, ) -> Self
Create a let binding
Sourcepub fn used_variables(&self) -> Vec<VarRef>
pub fn used_variables(&self) -> Vec<VarRef>
Collect all variables used in this expression
Trait Implementations§
impl<T> StructuralPartialEq for ANFExpr<T>
Auto Trait Implementations§
impl<T> Freeze for ANFExpr<T>where
T: Freeze,
impl<T> RefUnwindSafe for ANFExpr<T>where
T: RefUnwindSafe,
impl<T> Send for ANFExpr<T>where
T: Send,
impl<T> Sync for ANFExpr<T>where
T: Sync,
impl<T> Unpin for ANFExpr<T>where
T: Unpin,
impl<T> UnwindSafe for ANFExpr<T>where
T: 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