HH\Lib\Vec\chunk

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

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

Returns a vec containing the original vec split into chunks of the given size

Description

namespace HH\Lib\Vec;

function chunk<Tv>(
  Traversable<Tv> $traversable,
  int $size,
): vec<vec<Tv>>;

If the original vec doesn't divide evenly, the final chunk will be smaller.

Parameters