From: zverok.offline@... Date: 2020-11-17T15:50:26+00:00 Subject: [ruby-core:100907] [Ruby master Feature#17312] New methods in Enumerable and Enumerator::Lazy: flatten, product, compact Issue #17312 has been updated by zverok (Victor Shepelev). @mame @Dan0042 Oh, you are right, starting to think from `Enumerable::Lazy` perspective I've missed a huge incompatibility introduced by `flatten`. @mame I'll split into several proposals+patches: `Enumerable#compact`, and, I am starting to think now, maybe `Enumerator#flatten` would make some sense. As for `#product`, I just added it for completeness (as a method which also can work with unidirectional enumeration), I can't from the top of my head remember if I needed it some time in the past. ---------------------------------------- Feature #17312: New methods in Enumerable and Enumerator::Lazy: flatten, product, compact https://bugs.ruby-lang.org/issues/17312#change-88559 * Author: zverok (Victor Shepelev) * Status: Open * Priority: Normal ---------------------------------------- (The offspring of #16987, which was too vague/philosophical) I propose to add to `Enumerable` and `Enumerator::Lazy` the following methods: * `compact` * `product` * `flatten` All of them can be performed with a one-way enumerator. All of them make sense for situations other than "just an array". All of them can be used for processing large sequences, and therefore meaningful to add to `Lazy`. -- https://bugs.ruby-lang.org/ Unsubscribe: