Permalink
Browse files

Rename react/curry to react/partial

  • Loading branch information...
1 parent eb09d5f commit 1a869a983f3fd3caf6850a2596cefb528b1c20f7 @igorw igorw committed Aug 30, 2013
View
@@ -1,17 +1,17 @@
-# React/Curry
+# React/Partial
Partial function application.
-[![Build Status](https://secure.travis-ci.org/reactphp/curry.png?branch=master)](http://travis-ci.org/reactphp/curry)
+[![Build Status](https://secure.travis-ci.org/reactphp/partial.png?branch=master)](http://travis-ci.org/reactphp/partial)
## Install
-The recommended way to install react/curry is [through composer](http://getcomposer.org).
+The recommended way to install react/partial is [through composer](http://getcomposer.org).
```JSON
{
"require": {
- "react/curry": "~1.0"
+ "react/partial": "~1.0"
}
}
```
@@ -85,18 +85,18 @@ which will insert it to the left of the arguments list. The return value of
```php
<?php
-use React\Curry;
+use React\Partial;
public function handleDownload($filename)
{
- $this->downloadFile($filename, Curry\bind([$this, 'processDownloadResult'], $filename));
+ $this->downloadFile($filename, Partial\bind([$this, 'processDownloadResult'], $filename));
}
```
This is way cleaner. Sure, it's still a bit ugly due to the weird `::` and
`[$this, ...]` and so on, but it already helps quite a lot.
-Currying is dependency injection for functions! How awesome is that?
+Partialing is dependency injection for functions! How awesome is that?
## Examples
@@ -105,13 +105,13 @@ Currying is dependency injection for functions! How awesome is that?
```php
<?php
-use React\Curry;
+use React\Partial;
$add = function ($a, $b) {
return $a + $b;
};
-$addOne = Curry\bind($add, 1);
+$addOne = Partial\bind($add, 1);
echo sprintf("%s\n", $addOne(5));
// outputs 6
@@ -138,9 +138,9 @@ character of a string.
```php
<?php
-use React\Curry;
+use React\Partial;
-$firstChar = Curry\bind('substr', Curry\…(), 0, 1);
+$firstChar = Partial\bind('substr', Partial\…(), 0, 1);
$mapped = array_map($firstChar, array('foo', 'bar', 'baz'));
var_dump($mapped);
@@ -160,4 +160,4 @@ MIT, see LICENSE.
## Credits
* Thank you, Moses Schönfinkel (1889-1942).
-* Thank you, Haskell B. Curry (1900-1982).
+* Thank you, Haskell B. Partial (1900-1982).
View
@@ -1,14 +1,14 @@
{
- "name": "react/curry",
+ "name": "react/partial",
"description": "Partial function application.",
- "keywords": ["curry", "currying", "functional-programming"],
+ "keywords": ["partial", "functional-programming"],
"license": "MIT",
"require": {
"php": ">=5.3.2"
},
"autoload": {
- "psr-0": { "React\\Curry": "src" },
- "files": ["src/React/Curry/functions.php"]
+ "psr-0": { "React\\Partial": "src" },
+ "files": ["src/React/Partial/functions.php"]
},
"extra": {
"branch-alias": {
@@ -2,13 +2,13 @@
require __DIR__.'/../vendor/autoload.php';
-use React\Curry;
+use React\Partial;
$add = function ($a, $b) {
return $a + $b;
};
-$addOne = Curry\bind($add, 1);
+$addOne = Partial\bind($add, 1);
echo sprintf("%s\n", $addOne(5));
// outputs 6
View
@@ -12,7 +12,7 @@
bootstrap="vendor/autoload.php"
>
<testsuites>
- <testsuite name="React/Curry Test Suite">
+ <testsuite name="React/Partial Test Suite">
<directory>./tests/React/</directory>
</testsuite>
</testsuites>
@@ -1,6 +1,6 @@
<?php
-namespace React\Curry;
+namespace React\Partial;
final class Placeholder
{
@@ -1,6 +1,6 @@
<?php
-namespace React\Curry;
+namespace React\Partial;
final class Util
{
@@ -9,6 +9,6 @@ public static function bind(/*$fn, $args...*/)
$args = func_get_args();
$fn = array_shift($args);
- return call_user_func_array('React\Curry\bind', func_get_args());
+ return call_user_func_array('React\Partial\bind', func_get_args());
}
}
@@ -1,8 +1,8 @@
<?php
-namespace React\Curry;
+namespace React\Partial;
-use React\Curry\Placeholder;
+use React\Partial\Placeholder;
function bind(/*$fn, $args...*/)
{
@@ -1,6 +1,6 @@
<?php
-namespace React\Curry;
+namespace React\Partial;
class BindTest extends \PHPUnit_Framework_TestCase
{
@@ -1,15 +1,15 @@
<?php
-namespace React\Curry;
+namespace React\Partial;
-use React\Curry\Util as Curry;
+use React\Partial\Util as Partial;
class UtilTest extends \PHPUnit_Framework_TestCase
{
public function testBindWithTwoArgs()
{
$add = $this->createAddFunction();
- $addOneAndFive = Curry::bind($add, 1, 5);
+ $addOneAndFive = Partial::bind($add, 1, 5);
$this->assertSame(6, $addOneAndFive());
}

0 comments on commit 1a869a9

Please sign in to comment.