@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('eqProps', function (string $prop, $left, $right): bool { |
|
6 | +P::macro('eqProps', function(string $prop, $left, $right): bool { |
|
7 | 7 | return P::apply( |
8 | 8 | P::pipe( |
9 | 9 | P::map(P::prop($prop)), |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('pathEq', function (string $path, $value, array $object): bool { |
|
6 | +P::macro('pathEq', function(string $path, $value, array $object): bool { |
|
7 | 7 | return P::apply( |
8 | 8 | P::pipe( |
9 | 9 | P::path($path), |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('clamp', function ($min, $max, $value) { |
|
6 | +P::macro('clamp', function($min, $max, $value) { |
|
7 | 7 | return P::apply( |
8 | 8 | P::pipe( |
9 | 9 | P::min($max), |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | load_macro('logic', 'isEmpty'); |
8 | 8 | |
9 | -P::macro('last', call_user_func(function () { |
|
9 | +P::macro('last', call_user_func(function() { |
|
10 | 10 | $lastElement = P::slice(-1, 1); |
11 | 11 | $lastOfArray = P::pipe( |
12 | 12 | $lastElement, |
@@ -9,9 +9,9 @@ |
||
9 | 9 | load_macro('relation', 'equals'); |
10 | 10 | load_macro('fn', ['T', 'unapply', 'compose', 'throwException']); |
11 | 11 | |
12 | -P::macro('concat', call_user_func(function () { |
|
12 | +P::macro('concat', call_user_func(function() { |
|
13 | 13 | $argsToTypes = P::unapply(P::map('\\gettype')); |
14 | - $matchesType = function (string $type) use ($argsToTypes) { |
|
14 | + $matchesType = function(string $type) use ($argsToTypes) { |
|
15 | 15 | return P::compose(P::equals([$type, $type]), $argsToTypes); |
16 | 16 | }; |
17 | 17 |
@@ -3,11 +3,11 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('partition', function (callable $predicate, array $collection): array { |
|
6 | +P::macro('partition', function(callable $predicate, array $collection): array { |
|
7 | 7 | return P::apply( |
8 | 8 | P::pipe( |
9 | 9 | P::reduce( |
10 | - function ($carry, $item) use ($predicate) { |
|
10 | + function($carry, $item) use ($predicate) { |
|
11 | 11 | $key = $predicate($item) |
12 | 12 | ? 'left' |
13 | 13 | : 'right'; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | load_macro('type', ['typeCond', 'is']); |
11 | 11 | load_macro('collection', ['slice', 'length', 'nth']); |
12 | 12 | |
13 | -P::macro('head', call_user_func(function () { |
|
13 | +P::macro('head', call_user_func(function() { |
|
14 | 14 | $sliceFirst = P::slice(0, 1); |
15 | 15 | $moreThanZero = P::compose(P::lte(1), P::length()); |
16 | 16 | $headOfArray = P::cond([ |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('flatMap', function (callable $mapper, array $list): array { |
|
6 | +P::macro('flatMap', function(callable $mapper, array $list): array { |
|
7 | 7 | return P::apply( |
8 | 8 | P::pipe( |
9 | 9 | P::map($mapper), |
@@ -3,8 +3,8 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('cond', function (array $pairs): \Closure { |
|
7 | - return function (... $args) use ($pairs) { |
|
6 | +P::macro('cond', function(array $pairs): \Closure { |
|
7 | + return function(... $args) use ($pairs) { |
|
8 | 8 | $callPredicate = P::partialRight(P::apply(), [$args]); |
9 | 9 | $pairMatchingArgs = P::compose($callPredicate, P::nth(0)); |
10 | 10 | $getTransformer = P::pipe( |