Closed BooleanCat closed 2 months ago
Is your feature request related to a problem? Please describe.
It ought to be possible to find the max or min values of an iterator without storing the entire iterator in memory (collecting it).
Describe the solution you'd like
An iterator of comparable types can have the max or min values found using a function that consumes the iterator.
Provide code snippets to show how this new feature might be used.
numbers := iter.Take(iter.Count(), 15) fmt.Println(iter.Max(numbers)) // Output: 14
Does this incur a breaking change?
No.
Do you intend to build this feature yourself?
Yes.
Is your feature request related to a problem? Please describe.
It ought to be possible to find the max or min values of an iterator without storing the entire iterator in memory (collecting it).
Describe the solution you'd like
An iterator of comparable types can have the max or min values found using a function that consumes the iterator.
Provide code snippets to show how this new feature might be used.
Does this incur a breaking change?
No.
Do you intend to build this feature yourself?
Yes.