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
- Host: GitHub
- URL: https://github.com/coderaiser/uncurrify
- Owner: coderaiser
- License: mit
- Created: 2015-11-10T11:17:15.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-12-07T11:30:23.000Z (over 5 years ago)
- Last Synced: 2025-06-14T06:44:13.214Z (10 months ago)
- Language: JavaScript
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog
- License: LICENSE
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"