Requires the Hack Standard Library to be installed.

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

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.