@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $each = function (callable $fn, array $xs) { |
|
| 14 | + $each = function(callable $fn, array $xs) { |
|
| 15 | 15 | array_walk($xs, $fn); |
| 16 | 16 | return $xs; |
| 17 | 17 | }; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $args = func_get_args(); |
| 15 | 15 | |
| 16 | - $filter = function (callable $fn, array $xs) { |
|
| 16 | + $filter = function(callable $fn, array $xs) { |
|
| 17 | 17 | return array_filter($xs, $fn); |
| 18 | 18 | }; |
| 19 | 19 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $take = function ($n, array $xs) { |
|
| 14 | + $take = function($n, array $xs) { |
|
| 15 | 15 | return array_slice($xs, 0, $n); |
| 16 | 16 | }; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $concat = function ($a, $b /* ...$args */) { |
|
| 14 | + $concat = function($a, $b /* ...$args */) { |
|
| 15 | 15 | $rest = array_slice(func_get_args(), 2); |
| 16 | 16 | |
| 17 | 17 | return call_user_func_array('array_merge', array_merge([$a, $b], $rest)); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $args = func_get_args(); |
| 15 | 15 | |
| 16 | - $gte = function ($a, $b) { |
|
| 16 | + $gte = function($a, $b) { |
|
| 17 | 17 | return $a >= $b; |
| 18 | 18 | }; |
| 19 | 19 | |
@@ -11,8 +11,8 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $ifelse = function (callable $condition, callable $ontrue, callable $onfalse) { |
|
| 15 | - return function ($x) use ($condition, $ontrue, $onfalse) { |
|
| 14 | + $ifelse = function(callable $condition, callable $ontrue, callable $onfalse) { |
|
| 15 | + return function($x) use ($condition, $ontrue, $onfalse) { |
|
| 16 | 16 | if ($condition($x)) { |
| 17 | 17 | return $ontrue($x); |
| 18 | 18 | } |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | { |
| 14 | 14 | $args = func_get_args(); |
| 15 | 15 | |
| 16 | - $lte = function ($a, $b) { |
|
| 16 | + $lte = function($a, $b) { |
|
| 17 | 17 | return $a <= $b; |
| 18 | 18 | }; |
| 19 | 19 | |
@@ -10,14 +10,14 @@ |
||
| 10 | 10 | ); |
| 11 | 11 | |
| 12 | 12 | $countries = F\pipe( |
| 13 | - F\map(function ($x) { |
|
| 13 | + F\map(function($x) { |
|
| 14 | 14 | return $x['country']; |
| 15 | 15 | }), |
| 16 | 16 | $join |
| 17 | 17 | ); |
| 18 | 18 | |
| 19 | 19 | $cities = F\pipe( |
| 20 | - F\map(function ($x) { |
|
| 20 | + F\map(function($x) { |
|
| 21 | 21 | return $x['cities']; |
| 22 | 22 | }), |
| 23 | 23 | $join |
@@ -11,17 +11,17 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | $placeholder = pipe( |
| 14 | - filter(function ($x) { |
|
| 14 | + filter(function($x) { |
|
| 15 | 15 | return _ === $x; |
| 16 | 16 | }), |
| 17 | 17 | 'array_keys' |
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | - $hold = function (callable $fn) use ($placeholder) { |
|
| 20 | + $hold = function(callable $fn) use ($placeholder) { |
|
| 21 | 21 | $args = array_slice(func_get_args(), 1); |
| 22 | 22 | $ks = $placeholder($args); |
| 23 | 23 | |
| 24 | - return function ($x) use ($fn, $args, $ks) { |
|
| 24 | + return function($x) use ($fn, $args, $ks) { |
|
| 25 | 25 | if ([] === $ks) { |
| 26 | 26 | return call_user_func_array($fn, array_merge($args, [$x])); |
| 27 | 27 | } |