jxxcarlson / elm-lambda / Lambda.Expression

In this module we define the type Expr used to represent the lambda calculus. The main function is beta: Expr -> Expr which carries out beta reductions.


type Expr
    = Var String
    | Lambda String Expr
    | Apply Expr Expr

beta : Expr -> Expr

beta reduce expression

compressNameSpace : Expr -> Expr

Map variable names to "a", "b", ..., "z" to the extent possible

isNormal : Expr -> Basics.Bool

is the expression in normal form?

reduceSubscripts : Expr -> Expr

remove numeric subscripts in variable names to the extent possible