HH\Lib\Dict\pull

This API is part of the Hack Standard Library, not HHVM itself.

Returns a new dict where:

  • values are the result of calling $value_func on the original value
  • keys are the result of calling $key_func on the original value
namespace HH\Lib\Dict;

function pull<Tk as arraykey, Tv1, Tv2>(
    Traversable<Tv1> $traversable,
  (function(Tv1):Tv2) $value_func,
  (function(Tv1):Tk) $key_func,
): dict<Tk, Tv2>;

In the case of duplicate keys, later values will overwrite the previous ones.

Parameters