jxxcarlson/elm-lambda/1.0.0

Lambda.Parser

The primary function exported is

parse : String -> Result Error Expr

If application of parse to a string is successful it returns an Expr.

parse : String -> Result (List (DeadEnd Context Problem)) Expr
exprParser : Parser Context Problem Expr
> run exprParser "\\x.x(\\y.y)(\\z.z)"
Ok (Apply (Apply (LambdaTest "x" (Var "x")) (LambdaTest "y" (Var "y"))) (LambdaTest "z" (Var "z")))


> run exprParser "\\x.x(\\y.y)(\\z.z)" |> Result.map beta
Ok (LambdaTest "z" (Var "z"))