HH\Lib\Keyset\map_with_key
Returns a new keyset where each value is the result of calling the given function on the original key and value
namespace HH\Lib\Keyset;
function map_with_key<Tk, Tv1, Tv2 as arraykey>(
KeyedTraversable<Tk, Tv1> $traversable,
(function(Tk, Tv1): Tv2) $value_func,
): keyset<Tv2>;
Time complexity: O(n * f), where f is the complexity of $value_func
Space complexity: O(n)
Parameters
KeyedTraversable<Tk,
Tv1> $traversable
(function(Tk, Tv1): Tv2) $value_func
Returns
keyset<Tv2>