Skip to content

SeanCannon/fpure

Repository files navigation

fpure

Pure functional programming library (Work in progress -- use Ramda or Sanctuary while I build this out)

Build Status Coverage Status npm version Dependency Status

Install

$ npm install fpure --save

Run the specs

$ npm test

Usage

const fp = require('fpure');

fp.compose(fp.multiply(4), fp.add(3))(5); // 32
fp.compose(fp.add(3), fp.multiply(4))(5); // 23

Math

add

Number → Number

expect(add(4)(5)).toBe(9);
expect(add('4')('5')).toBe('45');
expect(add(4)('5')).toBe('45');
expect(add('4')(5)).toBe('45');

subtract

Number → Number

expect(subtract(8)(5)).toBe(3);
expect(subtract(5)(8)).toBe(-3);

multiply

Number → Number

expect(multiply(4)(5)).toBe(20);

About

Pure functional programming library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published