`Flow`s have a wonderful <catch> extension, and I ...
# stdlib
v
`Flow`s have a wonderful catch extension, and I wonder if a similar functionality could be added to `Sequence`s? The following implementation appears to work as expected:
Copy code
fun <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?