[lamcal] is a [Lambda Calculus] parser and evaluator written in [Rust]. It implements a pure untyped lambda calculus.
The library can be used to
parse_str("(λx.(λy.x y) a) b")
parse_str("(\\x.(\\y.x y) a) b")
lam("x", app(var("x"), var("y")))
app!
, e.g.
app![var("a"), var("b"), var("c")]
which is equivalent to
app(app(var("a"), var("b")), var("c))
The separate crate [lamcal-repl] provides a command line REPL (read-evaluate-print-loop) application to play around with lambda calculus terms and applying α-conversion and β-reduction interactively.
Features:
Term::reduce
,
that mutates the term in place and a standalone function, e.g. reduce
, that leaves the original
term unchanged and returns the result as a new term.failure
] crate compatible error types. To use [lamcal] as a library in your project add this to your Cargo.toml
file:
toml
[dependencies]
lamcal = "0.3"
and this to your crate root:
rust
extern crate lamcal;
For details about the library see the [documentation] at crates.io.
This library optionally supports the [failure
] crate. The support for the failure
crate is a crate
feature. To enable it add the dependency to your Cargo.toml
like so:
toml
[dependencies]
lamcal = { version = "0.3", features = ["failure"] }
Licensed under Apache License, Version 2.0
see [LICENSE] or http://www.apache.org/licenses/LICENSE-2.0 for details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.