refactor: extract abstract Expression interface

Introduce pkg/expr.Expression as a base interface for all evaluatable
expression types, enabling future support for multiple evaluation modes
(SKI combinators, typed lambda calculus, etc.).

- Add pkg/expr/expr.go with Expression interface requiring String() method.
- Update lambda.Expression to embed expr.Expression.
- Add String() method to Abstraction, Application, and Variable types.
- Update plugins to use String() instead of lambda.Stringify().
This commit is contained in:
2026-01-16 18:35:14 -05:00
parent 5c54f4e195
commit eba2182151
6 changed files with 39 additions and 15 deletions

11
pkg/expr/expr.go Normal file
View File

@@ -0,0 +1,11 @@
// Package expr provides the abstract Expression interface for all evaluatable
// expression types in the lambda interpreter.
package expr
// Expression is the base interface for all evaluatable expression types.
// Different evaluation modes (lambda calculus, SKI combinators, typed lambda
// calculus, etc.) implement this interface with their own concrete types.
type Expression interface {
// String returns a human-readable representation of the expression.
String() string
}