package coffee.liz.lambda.eval; import coffee.liz.lambda.ast.Expression; /** * Represents a runtime value produced by evaluation. */ public sealed interface Value permits Value.Closure, Value.Application, Value.Free { /** * A closure capturing an environment, parameter, and body. * * @param env * the captured environment * @param parameter * the bound parameter name * @param body * the lambda body expression */ record Closure(Environment env, String parameter, Expression body) implements Value { } /** * A symbolic application of a function to an argument. * * @param function * the function * @param argument * the argument */ record Application(Value function, Value argument) implements Value { } /** * A free variable. * * @param name * the variable name */ record Free(String name) implements Value { } }