<@U2E974ELT> ```public fun &lt;E, R&gt; ReceiveCh...
# coroutines
d
@elizarov
Copy code
public fun <E, R> ReceiveChannel<E>.flatMap(context: CoroutineContext = Unconfined, transform: suspend (E) -> ReceiveChannel<R>): ReceiveChannel<R>
is there any chance we will see overloaded flatmap in the lib with such param signature
Copy code
transform: (E) -> Iterable<R>
?
oups sorry, I read to fast
d
yes. i want just to extract collection elements in the channel's element
j
`Sequence<T>.flatMap(transform: (T) -> Iterable<R>): Sequence<R>`doesn't exist either...
I'd rather create
fun <T> Iterable<T>.toChannel(): ReceiveChannel<T> = produce { forEach { send(it) } }
e
We can have both. PRs are welcome
👍 1
i
@elizarov That would be an overload on lambda return type, which isn't supported yet in overload resolution.
e
Oops. Right. That’s a pity. We’ll have to wait for new type inference for that.