<commit_before>[![Build Status](https://travis-ci.org/stoeffel/chickencurry.svg)](https://travis-ci.org/stoeffel/chickencurry) [![npm version](https://badge.fury.io/js/chickencurry.svg)](http://badge.fury.io/js/chickencurry) [![Coverage Status](https://coveralls.io/repos/stoeffel/chickencurry/badge.svg?branch=master)](https://coveralls.io/r/stoeffel/chickencurry?branch=master)


:curry: Chickencurry
============

**Currying made simple.**



– and we really mean simple:

```js
import {curry, _} from 'chickencurry/module';


// Got a simple function?

const plus = (a, b, c) => a + b + c;
const plusThree = plus::curry(3);

plusThree(2, 2);  //» 7
plusThree(2)(2);  //» 7


// Got a monster function?

const {open} = require('fs');
const newScript = open::curry(_, 'w', 0755, _);

newScript('do-wonders.sh', (error, file) => {
  // The `file` is ready.
});
```





Installation
------------

```sh
npm install chickencurry
```




Usage
---

*Work in progress…*

### Placeholders

A placeholder `_` is a [Symbol](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol) `Symbol('CURRY-THIS-PLACEHOLDER')`.
Placeholders are replaced from left to right, the next call after a placeholder is passed replaces the previous placeholders one by one.

```js
const foo = (a, b, c, d) => [a, b, c, d];

const curriedFoo = foo::curry(_, _, _, 4); 

curriedFoo(1)(2)(3); //» [1, 2, 3, 4]
```

If you pass a placeholder to `curry` the length of the function is **ignored** instead the initial call of `curry` defines the length of the curried function.

```js
const foo = (...values) => values;

const curriedFoo = foo::curry(_, _, _);

curriedFoo(1)(2)(3); //» [1, 2, 3]
```

API
---

*Work in progress…*
<commit_msg>add basic usage example<commit_after>[![Build Status](https://travis-ci.org/stoeffel/chickencurry.svg)](https://travis-ci.org/stoeffel/chickencurry) [![npm version](https://badge.fury.io/js/chickencurry.svg)](http://badge.fury.io/js/chickencurry) [![Coverage Status](https://coveralls.io/repos/stoeffel/chickencurry/badge.svg?branch=master)](https://coveralls.io/r/stoeffel/chickencurry?branch=master)


:curry: Chickencurry
============

**Currying made simple.**



– and we really mean simple:

```js
import {curry, _} from 'chickencurry/module';


// Got a simple function?

const plus = (a, b, c) => a + b + c;
const plusThree = plus::curry(3);

plusThree(2, 2);  //» 7
plusThree(2)(2);  //» 7


// Got a monster function?

const {open} = require('fs');
const newScript = open::curry(_, 'w', 0755, _);

newScript('do-wonders.sh', (error, file) => {
  // The `file` is ready.
});
```





Installation
------------

```sh
npm install chickencurry
```




Usage
---

*Work in progress…*

### Basig usage

The function `curry` is invoked using the [function bind syntax](https://github.com/zenparsing/es-function-bind) and returns a curried function.

```js
const add = (a, b) => a + b;
const curriedAdd = add::curry();

curriedAdd(1)(2); //» 3
```


### Placeholders

A placeholder `_` is a [Symbol](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Symbol) `Symbol('CURRY-THIS-PLACEHOLDER')`.
Placeholders are replaced from left to right, the next call after a placeholder is passed replaces the previous placeholders one by one.

```js
const foo = (a, b, c, d) => [a, b, c, d];

const curriedFoo = foo::curry(_, _, _, 4); 

curriedFoo(1)(2)(3); //» [1, 2, 3, 4]
```

If you pass a placeholder to `curry` the length of the function is **ignored** instead the initial call of `curry` defines the length of the curried function.

```js
const foo = (...values) => values;

const curriedFoo = foo::curry(_, _, _);

curriedFoo(1)(2)(3); //» [1, 2, 3]
```

API
---

*Work in progress…*

{'fraction_non_alphanumeric': 0.19456289978678037, 'fraction_numerical': 0.014125799573560768, 'mean_word_length': 4.120054570259208, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 12, 'https://': 13, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2419812', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1347, 'n_words': 365}