An open API service indexing awesome lists of open source software.

https://github.com/coderaiser/uncurrify

uncurry function that was carried before
https://github.com/coderaiser/uncurrify

Last synced: 8 months ago
JSON representation

uncurry function that was carried before

Awesome Lists containing this project

README

          

# Uncurrify [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Dependency Status][DependencyStatusIMGURL]][DependencyStatusURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL]

Takes a function `f(x)` that returns another function `g(y)` as a result, and yields a new function `f′(x, y)` that takes a number of additional parameters and applies them to the function returned by function `f`.

## Install

```
npm i uncurrify --save
```

## How to use?

```js
const uncurrify = require('uncurrify');

const g = (x) => (y) => sum(x + y);
const f = (x) => g(x);
const sum = (x, y) => x + y;

ununcurrify(f)(2, 2);
// returns
4;
```

## License

MIT

[NPMIMGURL]: https://img.shields.io/npm/v/uncurrify.svg?style=flat
[BuildStatusIMGURL]: https://img.shields.io/travis/coderaiser/uncurrify/master.svg?style=flat
[DependencyStatusIMGURL]: https://img.shields.io/david/coderaiser/uncurrify.svg?style=flat
[LicenseIMGURL]: https://img.shields.io/badge/license-MIT-317BF9.svg?style=flat
[NPMURL]: https://npmjs.org/package/uncurrify "npm"
[BuildStatusURL]: https://travis-ci.org/coderaiser/uncurrify "Build Status"
[DependencyStatusURL]: https://david-dm.org/coderaiser/uncurrify "Dependency Status"
[LicenseURL]: https://tldrlegal.com/license/mit-license "MIT License"