Skip to content

Commit 70ca3a1

Browse files
committed
WIP
1 parent f6321a4 commit 70ca3a1

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/Functional/Curry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
*
2121
* @template TArg
2222
* @template TReturn
23-
* @psalm-type FunctionToCurry = callable(...TArg): TReturn
24-
* @psalm-type CurriedFunction = callable(...TArg): FunctionToCurry|CurriedFunction
25-
* @psalm FunctionToCurry $function the function you want to curry
23+
* @param callable(...TArg): TReturn $function the function you want to curry
2624
* @param bool $required curry optional parameters ?
27-
* @return CurriedFunction|FunctionToCurry a curryied version of the given function
25+
* @return callable(...TArg): callable a curryied version of the given function
2826
* @return callable
2927
*/
3028
function curry(callable $function, bool $required = true): callable

src/Functional/CurryN.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@
1919
*
2020
* @template TArg
2121
* @template TReturn
22-
* @psalm-type _FunctionToCurry = callable(...TArg): TReturn
23-
* @psalm-type _CurriedFunction = callable(...TArg): FunctionToCurry|CurriedFunction
2422
* @param int $count number of arguments you want to curry
25-
* @param FunctionToCurry $function the function you want to curry
26-
* @return CurriedFunction|FunctionToCurry a curryied version of the given function
23+
* @param callable(...TArg): TReturn $function the function you want to curry
24+
* @return callable(...TArg): callable a curryied version of the given function
2725
* @return callable
2826
*/
2927
function curry_n($count, callable $function): callable
3028
{
3129
/**
3230
* @param list<TArg> $arguments
33-
* @return CurriedFunction
31+
* @return callable(...TArg): callable
3432
*/
3533
$accumulator = static function (array $arguments) use ($count, $function, &$accumulator): callable {
3634
return
3735
/**
3836
* @psalm-param TArg $newArguments
39-
* @psalm-return CurriedFunction|FunctionToCurry
37+
* @psalm-return callable(...TArg): callable
4038
*/
4139
static function (...$newArguments) use ($count, $function, $arguments, $accumulator) {
4240
$arguments = \array_merge($arguments, $newArguments);

0 commit comments

Comments
 (0)