@@ -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,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $id = function ($x) { |
|
| 14 | + $id = function($x) { |
|
| 15 | 15 | return $x; |
| 16 | 16 | }; |
| 17 | 17 | |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | $args = func_get_args(); |
| 11 | 11 | |
| 12 | - $last = function ($xs) { |
|
| 12 | + $last = function($xs) { |
|
| 13 | 13 | return get(array_values(array_slice($xs, -1)), 0); |
| 14 | 14 | }; |
| 15 | 15 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $head = function ($xs) { |
|
| 14 | + $head = function($xs) { |
|
| 15 | 15 | if ([] === $xs |
| 16 | 16 | || '' === $xs |
| 17 | 17 | || null === $xs |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $tail = function (array $xs) { |
|
| 14 | + $tail = function(array $xs) { |
|
| 15 | 15 | return array_slice($xs, 1); |
| 16 | 16 | }; |
| 17 | 17 | |
@@ -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 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | { |
| 12 | 12 | $args = func_get_args(); |
| 13 | 13 | |
| 14 | - $drop = function ($n, array $xs) { |
|
| 14 | + $drop = function($n, array $xs) { |
|
| 15 | 15 | return array_slice($xs, $n); |
| 16 | 16 | }; |
| 17 | 17 | |