Skip to content

paulshestakov/lambda-arithmetics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm

Arithmetics in lambda calculus

Boolean

const { _true, _false, not, or, and } = require("./boolean");

not(_true);
// => _false

or(_true)(_false);
// => _true

and(_false)(_true);
// => _false

Numbers

const { zero, is_zero, succ, pred } = require("./numbers");

const one = succ(zero)

is_zero(zero);
// => _true

pred(one);
// => zero

Recursion

const { zero, succ, eq, add } = require("lambda-arithmetics");

const two = succ(succ(zero));
const four = succ(succ(two));

eq(add(two)(two))(four)) 
// => _true

About

Arithmetics in lambda calculus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published