diff --git a/pkg/lambda/expression.go b/pkg/lambda/expression.go index d9678d2..affaf54 100644 --- a/pkg/lambda/expression.go +++ b/pkg/lambda/expression.go @@ -1,13 +1,11 @@ package lambda -// Expression represents an immutable lambda calculus expression. type Expression interface { Accept(Visitor) } /** ------------------------------------------------------------------------- */ -// Abstraction represents a lambda abstraction (λx. body). type Abstraction struct { parameter string body Expression @@ -31,7 +29,6 @@ func NewAbstraction(parameter string, body Expression) *Abstraction { /** ------------------------------------------------------------------------- */ -// Application represents function application (f arg). type Application struct { function Expression argument Expression @@ -55,7 +52,6 @@ func NewApplication(function Expression, argument Expression) *Application { /** ------------------------------------------------------------------------- */ -// Variable represents a variable reference. type Variable struct { value string } diff --git a/pkg/lambda/rename.go b/pkg/lambda/rename.go index 3a1d687..7a52796 100644 --- a/pkg/lambda/rename.go +++ b/pkg/lambda/rename.go @@ -1,6 +1,5 @@ package lambda -// Rename replaces all occurrences of target variable with newName. func Rename(expr Expression, target string, newName string) Expression { switch e := expr.(type) { case *Variable: diff --git a/pkg/lambda/substitute.go b/pkg/lambda/substitute.go index d2bb3d9..b89f8e0 100644 --- a/pkg/lambda/substitute.go +++ b/pkg/lambda/substitute.go @@ -1,6 +1,5 @@ package lambda -// Substitute replaces all free occurrences of target with replacement. func Substitute(expr Expression, target string, replacement Expression) Expression { switch e := expr.(type) { case *Variable: