Module Lambda_lib.Interpret

type prim =
  1. | Print_int
  2. | Fix
type value =
  1. | VInt of int
  2. | VClosure of closure
  3. | VPrim of prim
  4. | VUnit
and closure = {
  1. param : Ast.name;
  2. body : Ast.expr;
  3. env : env;
}
and env = (Ast.name * value) list
type error =
  1. | Unknown_variable of Ast.name
  2. | Not_a_function of value
  3. | Div_by_zero
  4. | Type_error of string
  5. | Out_of_fuel
type 'a eval_result = ('a, error) Stdlib.result
val ok : 'a -> 'a eval_result
val error : error -> 'a eval_result
val (let*) : 'a eval_result -> ('a -> 'b eval_result) -> 'b eval_result
type fuel = int
val tick : fuel -> (unit * fuel, error) Stdlib.result
val eval : env -> fuel -> Ast.expr -> (value * fuel, error) Stdlib.result
val initial_env : env
val string_of_value : value -> string
val string_of_error : error -> string