dankogai / js-parens

the () language in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ES2015 MIT LiCENSE CI via GitHub Actions

js-parens

the () language in JavaScript. Plus {unlambda,iota,jot} implementations, combinator logics and lambda calculi.

Synopsis

import {
  combinators, church, iota, jot, parens, unlambda 
} from './index.js';
// They all compile to the identity function,
// or the I combinator,
// or 1 in church numeral
   parens.compile('()'                  )(n => n+1)(0); // 1
     iota.compile('*ii'                 )(n => n+1)(0); // 1
      jot.compile('11111110001110011100')(n => n+1)(0); // 1
unlambda.compile('``skk'                )(n => n+1)(0); // 1
                            combinators.I(n => n+1)(0); // 1

You can also import individual language as:

import * as parens from './parens.js';
parens.compile('((()))(())'             )(n => n+1)(0); // 0

About

the () language in JavaScript

License:MIT License


Languages

Language:JavaScript 92.8%Language:HTML 7.2%