HH\Iterable
Represents any entity that can be iterated over using something like
foreach
The entity does not necessarily have to have a key, just values.
Iterable does not include arrays.
Guides
Interface Synopsis
namespace HH;
interface Iterable implements Traversable<Tv>, \IteratorAggregate<Tv> {...}
Public Methods
->concat<Tu super Tv>(Traversable<Tu> $traversable): Iterable<Tu>
Returns anIterablethat is the concatenation of the values of the currentIterableand the values of the providedTraversable->filter((function(Tv): bool) $fn): Iterable<Tv>
Returns anIterablecontaining the values of the currentIterablethat meet a supplied condition->firstValue(): ?Tv
Returns the first value in the currentIterable->getIterator(): Iterator<Tv>
Returns an iterator that points to beginning of the currentIterable->lastValue(): ?Tv
Returns the last value in the currentIterable->lazy(): Iterable<Tv>
Returns a lazy, access elements only when needed view of the currentIterable->map<Tu>((function(Tv): Tu) $fn): Iterable<Tu>
Returns anIterablecontaining the values after an operation has been applied to each value in the currentIterable->skip(int $n): Iterable<Tv>
Returns anIterablecontaining the values after then-th element of the currentIterable->skipWhile((function(Tv): bool) $fn): Iterable<Tv>
Returns anIterablecontaining the values of the currentIterablestarting after and including the first value that producestruewhen passed to the specified callback->slice(int $start, int $len): Iterable<Tv>
Returns a subset of the currentIterablestarting from a given key up to, but not including, the element at the provided length from the starting key->take(int $n): Iterable<Tv>
Returns anIterablecontaining the firstnvalues of the currentIterable->takeWhile((function(Tv): bool) $fn): Iterable<Tv>
Returns anIterablecontaining the values of the currentIterableup to but not including the first value that producesfalsewhen passed to the specified callback->toImmSet(): ImmSet<Tv>
Returns an immutable set (ImmSet) converted from the currentIterable->toImmVector(): ImmVector<Tv>
Returns an immutable vector (ImmVector) converted from the currentIterable->toValuesArray(): varray<Tv>
Returns anarraywith the values from the currentIterable->values(): Iterable<Tv>
Returns anIterablecontaining the currentIterable's values->zip<Tu>(Traversable<Tu> $traversable): Iterable<Pair<Tv, Tu>>
Returns anIterablewhere each element is aPairthat combines the element of the currentIterableand the providedTraversable