pub enum Value {
Lit(Literal),
Con(DataConId, Vec<Value>),
Closure(Env, VarId, CoreExpr),
ThunkRef(ThunkId),
JoinCont(Vec<VarId>, CoreExpr, Env),
ConFun(DataConId, usize, Vec<Value>),
}Expand description
Runtime value for the tree-walking interpreter.
Variants§
Lit(Literal)
Literal value (Int, Word, Char, String, Float, Double)
Con(DataConId, Vec<Value>)
Fully-applied data constructor
Closure(Env, VarId, CoreExpr)
Closure: captured env + binder + body
ThunkRef(ThunkId)
Reference to a heap-allocated thunk
JoinCont(Vec<VarId>, CoreExpr, Env)
Join point continuation (lives in Env only, never heap-allocated)
ConFun(DataConId, usize, Vec<Value>)
Partially-applied data constructor: (tag, arity, accumulated args) When all args are supplied, collapses to Con.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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