for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace loophp\combinator\Combinator;
use Closure;
use loophp\combinator\Combinator;
/**
* Class V.
*
* @psalm-template AType
* @psalm-template BType
* @psalm-template CType
*/
final class V extends Combinator
{
* @var callable
private $f;
* @var mixed
private $x;
private $y;
* V constructor.
* @psalm-param AType $x
* @psalm-param BType $y
* @psalm-param callable(AType): callable(BType): CType $f
* @param mixed $x
* @param mixed $y
* @param callable $f
public function __construct($x, $y, callable $f)
$this->f = $f;
$this->x = $x;
$this->y = $y;
}
* @psalm-return CType
public function __invoke()
return (($this->f)($this->x))($this->y);
* @param callable $a
* @return Closure
public static function on($a): Closure
return static function ($b) use ($a): Closure {
return static function (callable $c) use ($a, $b) {
return (new self($a, $b, $c))();
};