lstrojny / functional-php

Primitives for functional programming in PHP
MIT License
1.98k stars 204 forks source link

`take_left(sequence_linear(date('Y') - 3, 1), 3)` infinite loop #245

Open Maxdw opened 2 years ago

Maxdw commented 2 years ago

Expected take_left to support iterators without requiring fully iterating through it. Because sequence_linear returns an infinite iterator the take_left function is never able to provide the first $count of iteration values due to its use of array_to_iterator.