Using transformations for sequences with flows?

Hi,

is it possible to use transformations for sequences with flows?

Because sequences have much more transformations than flows. So I would love to use those transformations on flows.

So is there some function which allows me to do it? Eg:

fun <A, B> Flow<A>.transformUsingSequence(f: (Sequence<A>) -> Sequence<B>): Flow<B>

Sample usage:

// Since chunked doesn't exist for flows, we use version for sequences.
val newFlow = myFlow.transformUsingSequence { it.chunked(10) }

I do not think it is possible to do it directly. The sequence could be converted to Flow, but Flow could not be in general converted to Sequence without losing Flow semantics. Probably it is possible to do something with complicated scope compositions, but it is much better to replicate the required sequence functions for Flow.