HH\ImmSet::zip
Throws an exception unless the current ImmSet
or the Traversable
is
empty
public function zip<Tu>(
Traversable<Tu> $traversable,
): ImmSet<HH\nothing>;
Since ImmSet
s only support integers or strings as values, we cannot
have a Pair
as an ImmSet
value. So in order to avoid an
InvalidArgumentException
, either the current ImmSet
or the
Traversable
must be empty so that we actually return an empty ImmSet
.
Parameters
Traversable<Tu>
$traversable
- TheTraversable
to use to combine with the elements of the currentImmSet
.
Returns
ImmSet<HH\nothing>
- TheImmSet
that combines the values of the currentImmSet
with the providedTraversable
; one of these must be empty or an exception is thrown.
Examples
See [Set::zip
](</hack/reference/class/Set/zip/#examples>) for usage examples.