Kelvin Chung
06/06/2024, 7:54 PMProvider<List<String>> to Sequence<String> or a FileCollection to a Sequence<File>? Or am I off-base in terms of the lazy semantics contained therein?Octavia Togami
06/06/2024, 8:02 PMSequence vs Iterable is mostly a distinction for the methods available on them, not in how the data is generated -- there's no benefit in adding a specific integration here vs. just calling asSequence() on the existing Iterable implementation. https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/as-sequence.htmlOctavia Togami
06/06/2024, 8:04 PMProvider<List<...>> could perhaps benefit, but I don't know if it's useful enough to warrant such an extension. You also have to consider that it loses task dependency information that could be retained by staying with a Provider.Kelvin Chung
06/06/2024, 8:05 PMval provider: Provider<List<String>>
val sequence = sequence {
yieldAll(provider.get())
}Octavia Togami
06/06/2024, 8:07 PMProvider should not be resolved before execution though, so I'm unsure how much value there is in having such a sequence. You might as well just wait to get an iterator directly from the List once you need it.Octavia Togami
06/06/2024, 8:08 PM