HH\Lib\Dict\unique

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

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

Returns a new dict in which each value appears exactly once

Description

namespace HH\Lib\Dict;

function unique<Tk as arraykey, Tv as arraykey>(
  KeyedTraversable<Tk, Tv> $traversable,
): dict<Tk, Tv>;

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

For non-arraykey values, see Dict\unique_by().

Parameters