style: removed unneeded comments
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
package lambda
|
package lambda
|
||||||
|
|
||||||
// Expression represents an immutable lambda calculus expression.
|
|
||||||
type Expression interface {
|
type Expression interface {
|
||||||
Accept(Visitor)
|
Accept(Visitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ------------------------------------------------------------------------- */
|
/** ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// Abstraction represents a lambda abstraction (λx. body).
|
|
||||||
type Abstraction struct {
|
type Abstraction struct {
|
||||||
parameter string
|
parameter string
|
||||||
body Expression
|
body Expression
|
||||||
@@ -31,7 +29,6 @@ func NewAbstraction(parameter string, body Expression) *Abstraction {
|
|||||||
|
|
||||||
/** ------------------------------------------------------------------------- */
|
/** ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// Application represents function application (f arg).
|
|
||||||
type Application struct {
|
type Application struct {
|
||||||
function Expression
|
function Expression
|
||||||
argument Expression
|
argument Expression
|
||||||
@@ -55,7 +52,6 @@ func NewApplication(function Expression, argument Expression) *Application {
|
|||||||
|
|
||||||
/** ------------------------------------------------------------------------- */
|
/** ------------------------------------------------------------------------- */
|
||||||
|
|
||||||
// Variable represents a variable reference.
|
|
||||||
type Variable struct {
|
type Variable struct {
|
||||||
value string
|
value string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package lambda
|
package lambda
|
||||||
|
|
||||||
// Rename replaces all occurrences of target variable with newName.
|
|
||||||
func Rename(expr Expression, target string, newName string) Expression {
|
func Rename(expr Expression, target string, newName string) Expression {
|
||||||
switch e := expr.(type) {
|
switch e := expr.(type) {
|
||||||
case *Variable:
|
case *Variable:
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package lambda
|
package lambda
|
||||||
|
|
||||||
// Substitute replaces all free occurrences of target with replacement.
|
|
||||||
func Substitute(expr Expression, target string, replacement Expression) Expression {
|
func Substitute(expr Expression, target string, replacement Expression) Expression {
|
||||||
switch e := expr.(type) {
|
switch e := expr.(type) {
|
||||||
case *Variable:
|
case *Variable:
|
||||||
|
|||||||
Reference in New Issue
Block a user