<commit_before>autoCurry
=========

Enables automatic currying of functions. Every call to an ``autoCurry``ed function
will return a new function accepting the remaining function parameters until all
parameters have been gathered whereupon the wrapped function will be executed
and return its value.

Note that the function not only works on other functions, it also works on
objects implementing ``__invoke()``, closures, static methods and standard
object methods.


Usage
-----

```php
$add = m4rw3r\autoCurry(function($a, $b) {
	return $a + $b;
});

$add5 = $add(5);

var_dump($add5(3)); /* int(8) */

$concat = m4rw3r\autoCurry(function($a, $b) {
	return $a . $b;
});

$namePrefix = $concat('Test');

$names = array_map($namePrefix, ['Foo', 'Bar']);
/* array(2) { [0] => string(7) "TestFoo" [1] => string(7) "TestBar" } */
```

Prototype
---------

```php
callable m4rw3r\autoCurry(callable [, num_params = false])<commit_msg>README.md: Added link to video which demonstrated usage of it in JavaScript<commit_after>autoCurry
=========

Enables automatic currying of functions. Every call to an ``autoCurry``ed function
will return a new function accepting the remaining function parameters until all
parameters have been gathered whereupon the wrapped function will be executed
and return its value.

Note that the function not only works on other functions, it also works on
objects implementing ``__invoke()``, closures, static methods and standard
object methods.

To see how autoCurry can help you write very terse code, watch this video:
[Hey underscore, you're doing it wrong!](https://www.youtube.com/watch?v=m3svKOdZijA)

Usage
-----

```php
$add = m4rw3r\autoCurry(function($a, $b) {
	return $a + $b;
});

$add5 = $add(5);

var_dump($add5(3)); /* int(8) */

$concat = m4rw3r\autoCurry(function($a, $b) {
	return $a . $b;
});

$namePrefix = $concat('Test');

$names = array_map($namePrefix, ['Foo', 'Bar']);
/* array(2) { [0] => string(7) "TestFoo" [1] => string(7) "TestBar" } */
```

Prototype
---------

```php
callable m4rw3r\autoCurry(callable [, num_params = false])
{'fraction_non_alphanumeric': 0.15875299760191847, 'fraction_numerical': 0.015827338129496403, 'mean_word_length': 4.730769230769231, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '5743762', 'n_tokens_mistral': 695, 'n_tokens_neox': 676, 'n_words': 230}