HH\Lib\Dict\from_values

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

This function is available as Dict\from_values() in Facebook's www repository.

Returns a new dict keyed by the result of calling the given function on each corresponding value

Description

namespace HH\Lib\Dict;

function from_values<Tk as arraykey, Tv>(
  Traversable<Tv> $values,
  (function(Tv):Tk) $key_func,
): dict<Tk, Tv>;

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

Parameters