/FunctionalList.js

A list implementation in pure lambda expressions using javascript

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

FunctionalList.js

A 100% functional list implementation in js

  • Pure Magic.
  • 100% Based on λ expressions.
  • Easy to use.

Instalation

  $ npm i functional-list

Example

const { head, tail, List, print } = require("./FunctionalList");

const l = List(1, 2, 3, 5, 6, 7, 8);

const one = head(l); //one === 1
const two = head(tail(l)); //two === 2

print(l); //console.logs "List(1, 2, 3, 4, 5, 6, 7, 8)"
print(tail(l)); //console.logs "List(2, 3, 4, 5, 6, 7, 8)"

How it works

Please read the code to understand until we write something here. More is yet to come...