static function map(\CharlotteDunois\Phoebe\Pool $pool, array $array, callable $function) {
        $promises = array();
        
        foreach($array as $id => $arg) {
            $promises[$id] = static::parallelize($pool, $function, array($arg))->then(null, function (\Throwable $e) {
                return $e;
            });
        }
        
        return \React\Promise\all($promises)->then(\Closure::fromCallable(array(self::class, 'convertResult')));
    }