Skip to content

gonzaloruizdevilla/alicates

Repository files navigation

Alicates

Build Status Coverage Status

Compact functional library made with ES2015

Functions implemented in the library are very small but not necessarily very efficient (yet). Like RamdaJS (http://ramdajs.com) and written with ES2015.

A lot of development and documentation has to be done before this can be used for more than passing its own tests.

Why Alicates?

Because it's funny to implement functions like curry with (Java|Ecma)Script like this:

const curry = (fn, arity) => (curried =>
  curried = (...args) =>
    args.length < (arity || fn.length) ? (...more) => curried(...args, ...more)
                                       : fn(...args)
)();

Or to implement a zip function like:

const zip = (arr1, arr2) => (
   ((aux) =>
      (aux = ([x1,...arr1], [x2,...arr2], acc) =>
        x1 === undefined || x2 === undefined ? acc
                                             : aux(arr1, arr2, [...acc, [x1, x2]])
      )(arr1, arr2, [])
    )()
);

Getting Started

Install it via npm:

npm install alicates

And include in your project:

var alicates = require("alicates");

License

MIT

About

Small library for functional programming with ES2015+

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published