UNPKG

lambda-calculus-with-js

Version:

Using JS' anonymous functions to perform lambda calculus

7 lines (6 loc) 328 B
import { yC } from '..'; import { indexed, l0, pushedTail } from './list'; export const interpreter = yC(s => r => n => s(n(r)))(x => x(l0)); export const macroCall = P => x => y => P(l => x(l)(y(l))); export const macroFunc = P => d => P(l => x => d(pushedTail(l)(x))); export const macroArg = n => P => P(l => indexed(l)(n));