Church encoding is a way of encoding data using only functions. For instance, we can use functions to represent, booleans, numerals and lists. Higher-order functions are all you need for Turing completeness.
Check out the docs.
npm i church or
yarn add church.
const twoFourSix = three// => Church encoded list of [two four six]const twoFourSixJs =// => [2, 4, 6] (standard JS array of standard JS numbers)// => Church encoded list of [two four six] againtwoFourSix// => Church encoded list of [five five six]
- combinators-js - a library of combinators in JS I wrote
- http://raganwald.com/2015/02/13/functional-quantum-electrodynamics.html - totally mind-blowing article, this repo probably would not exist if I hadn't read it