Files
lambda/internal/plugins/debug.go
M.V. Hutz eba2182151 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().
2026-01-16 18:35:14 -05:00

24 lines
416 B
Go

package plugins
import (
"log/slog"
"git.maximhutz.com/max/lambda/internal/engine"
)
type Logs struct {
logger *slog.Logger
process *engine.Engine
}
func NewLogs(logger *slog.Logger, process *engine.Engine) *Logs {
plugin := &Logs{logger, process}
process.On(engine.StepEvent, plugin.Step)
return plugin
}
func (t *Logs) Step() {
t.logger.Info("reduction", "tree", (*t.process.Expression).String())
}