Vasily
04/21/2025, 12:14 PMfun <T> Sequence<T>.catch(action: suspend SequenceScope<T>.(Throwable) -> Unit): Sequence<T> {
return sequence {
try {
forEach { yield(it) }
} catch (t: Throwable) {
action(t)
}
}
}
Is the implementation correct?
If so, could it be added to stdlib?