Widmogrod\Monad\IO::reduce PHP Method

reduce() public method

public reduce ( callable $function, $accumulator )
$function callable
    public function reduce(callable $function, $accumulator)
    {
        return static::of(function () use($function, $accumulator) {
            return call_user_func($function, $accumulator, $this->run());
        });
    }