HH\Lib\Dict\from_keys

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

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

Returns a new dict where each value is the result of calling the given function on the corresponding key

Description

namespace HH\Lib\Dict;

function from_keys<Tk as arraykey, Tv>(
  Traversable<Tk> $keys,
  (function(Tk):Tv) $value_func,
): dict<Tk, Tv>;

To use an async function, see Dict\from_keys_async(). To create a dict from values, see Dict\from_values(). To create a dict from key/value pairs, see Dict\from_entries().

Parameters