pub fn eval(
expr: &Expr,
env: &Env,
heap: Heap,
fuel: Fuel,
) -> Result<(Value, Heap, Fuel), Error>Expand description
Evaluate expr against env with the given heap and step budget.
§Errors
See Error for the full list of failure modes.
§Examples
use lambda_throw_cat::env::Env;
use lambda_throw_cat::eval::{eval, Fuel};
use lambda_throw_cat::heap::Heap;
use lambda_throw_cat::syntax::Expr;
let id = Expr::lam("x", Expr::var("x"));
let (value, _heap, _fuel) = eval(&id, &Env::empty(), Heap::empty(), Fuel::new(100))?;
assert_eq!(format!("{value}"), "\\x. x");