PHP Interface Widmogrod\FantasyLand\Foldable

Show file Open project: widmogrod/php-functional Interface Usage Examples

Public Methods

Method Description
reduce ( callable $function, mixed $accumulator ) : mixed reduce :: (b -> a -> b) -> b -> b

Method Details

reduce() public method

reduce :: (b -> a -> b) -> b -> b
public reduce ( callable $function, mixed $accumulator ) : mixed
$function callable Binary function ($accumulator, $value)
$accumulator mixed Value to witch reduce
return mixed Same type as $accumulator