HH\Lib\Vec\sample

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

This function is available as Vec\sample() in Facebook's www repository.

Returns a new vec containing an unbiased random sample of up to $sample_size elements (fewer iff $sample_size is larger than the size of $traversable)

Description

namespace HH\Lib\Vec;

function sample<Tv>(
  Traversable<Tv> $traversable,
  int $sample_size,
): vec<Tv>;

Parameters