@@ -3,10 +3,10 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lens', function (callable $getter, callable $setter) { |
|
7 | - return P::curryN(2, function (callable $toFunctorFn, $target) use ($getter, $setter) { |
|
6 | +P::macro('lens', function(callable $getter, callable $setter) { |
|
7 | + return P::curryN(2, function(callable $toFunctorFn, $target) use ($getter, $setter) { |
|
8 | 8 | return P::map( |
9 | - function ($focus) use ($target, $setter) { |
|
9 | + function($focus) use ($target, $setter) { |
|
10 | 10 | return $setter($focus, $target); |
11 | 11 | }, |
12 | 12 | $toFunctorFn($getter($target)) |
@@ -4,9 +4,9 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use Baethon\Phln\Monad\Constant; |
6 | 6 | |
7 | -P::macro('view', function (callable $lens, $targetData) { |
|
7 | +P::macro('view', function(callable $lens, $targetData) { |
|
8 | 8 | return $lens( |
9 | - function ($value) { |
|
9 | + function($value) { |
|
10 | 10 | return new Constant($value); |
11 | 11 | }, |
12 | 12 | $targetData |
@@ -3,6 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('set', function (callable $lens, $value, $targetData) { |
|
6 | +P::macro('set', function(callable $lens, $value, $targetData) { |
|
7 | 7 | return P::over($lens, P::always($value), $targetData); |
8 | 8 | }); |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lensPath', function (string $path) { |
|
6 | +P::macro('lensPath', function(string $path) { |
|
7 | 7 | return P::lens( |
8 | 8 | P::path($path), |
9 | 9 | P::assocPath($path) |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lensProp', function (string $prop) { |
|
6 | +P::macro('lensProp', function(string $prop) { |
|
7 | 7 | return P::lens( |
8 | 8 | P::prop($prop), |
9 | 9 | P::assoc($prop) |
@@ -4,9 +4,9 @@ |
||
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | use Baethon\Phln\Monad\Identity; |
6 | 6 | |
7 | -P::macro('over', function (callable $lens, callable $fn, $targetData) { |
|
7 | +P::macro('over', function(callable $lens, callable $fn, $targetData) { |
|
8 | 8 | return $lens( |
9 | - function ($value) use ($fn) { |
|
9 | + function($value) use ($fn) { |
|
10 | 10 | return Identity::of($fn($value)); |
11 | 11 | }, |
12 | 12 | $targetData |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use Baethon\Phln\Duck; |
5 | 5 | use Baethon\Phln\Phln as P; |
6 | 6 | |
7 | -P::macro('map', function (callable $fn, $collection) { |
|
7 | +P::macro('map', function(callable $fn, $collection) { |
|
8 | 8 | assert(is_array($collection) || Duck::isFunctor($collection)); |
9 | 9 | |
10 | 10 | return is_array($collection) |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('update', function (int $index, $value, array $collection): array { |
|
6 | +P::macro('update', function(int $index, $value, array $collection): array { |
|
7 | 7 | |
8 | 8 | if (false === array_key_exists($index, $collection)) { |
9 | 9 | return $collection; |
@@ -3,7 +3,7 @@ |
||
3 | 3 | |
4 | 4 | use Baethon\Phln\Phln as P; |
5 | 5 | |
6 | -P::macro('lensIndex', function (int $index) { |
|
6 | +P::macro('lensIndex', function(int $index) { |
|
7 | 7 | return P::lens( |
8 | 8 | P::nth($index), |
9 | 9 | P::update($index) |