iter
iter copied to clipboard
Package iter provides generic, lazy iterators, functions for producing them from primitive types, as well as functions and methods for transforming and consuming them.
Currently, to use iterator combinators, users have to write something like: ```go iter0 := iter.Elems(someSlice) iter1 := iter.Map(iter0, someFunc) iter2 := iter.Map(iter1, someFunc) // ... ``` Users have to repeatedly...
Currently, the implementation of the `Collect` doesn't reserve capacity for iterator: https://github.com/mtoohey31/iter/blob/7eec6de0d2ad032b51126c2df2f68a75dfde5d2a/iter.go#L51 But actually, iterator can provide size hint to indicate how much memory it needs. Rust adopt such implementation:...