iter
iter copied to clipboard
Iteration primitives using generators
The return type of `IteratorAggregate::getIterator` is `Traversable`, but `toIter` assumes the value returned will be of type `Iterator`. The return type check on `toIter` therefore fails when `getIterator` returns another...
I don't know if it would be relevant or not. Some benchmark might be required to determine whether or not the original json_encode would fail on big arrays with big...
Closes #31 . Add \iter\unique which returns an iterator with unique values.
Would be nice to have a function that fetches the head of an iterable and throws an exception if it's non-empty instead of having to call the `current` function on...
Hello, Is there any reason to prefer the anonymous function than the IteratorIterator ?
The taken and slice variants don't consume the generator. I need the equivalent of array_splice or head in haskell. Take the head off the iterable, and consume it, so that...
Takes an iterator and cycles through its elements a given number of times If working with a generator it is best to make it rewindable if the expected number of...
@nikic what do you think about adding `unique` method to get iterator of unique values?
We have a use case where we need to get a value by its index. In that sense, I'd like to suggest introducing a function `at/get(iterable $iterable, int $index) :...
I could help with that, but I want to get confirmation first.