@calculemus/abt-lambda
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

Lambda calculus

npm version Build Status Dependency Status Dev Dependency Status Coverage Status

Demonstration of the @calculemus/abt library.

Based on Peter Sestoft's Demonstrating Lambda Calculus Reduction.

Using the evaluator

You can try the following code over at RunKit:

const abtLambda = require("@calculemus/abt-lambda");

// Parse, evaluate, and print as different steps
const [fv, e] = abtLambda.parse("x (x => (x => x) y x)");
console.log(abtLambda.toString(e));
const [gas, norm] = abtLambda.callByName.normalize(100, fv, e);
console.log(abtLambda.toString(norm));

// Do all of that at once
console.log(abtLambda.evaluate("(x => y => x y) (y => x) z"));

Readme

Keywords

none

Package Sidebar

Install

npm i @calculemus/abt-lambda

Weekly Downloads

0

Version

0.0.6

License

ISC

Unpacked Size

24.3 kB

Total Files

20

Last publish

Collaborators

  • calculemus