title: How to handle elements that fell through a filter when using Sequence in Kotlin
body: <p>I would like to filter a list and log the items which fell through the filter, similar to this:</p>
  
  <pre><code>val evenNumbers = (1..10)
              .filter { it % 2 == 0 }
              .onFallThrough { println("dropped $it") }  // wishful Kotlin
              .toList()
  </code></pre>
  
  <p>This should then lead to the following output:</p>
  
  <pre><code>dropped 1
  dropped 3
  dropped 5
  dropped 7
  dropped 9
  </code></pre>
  
  <p>as well as all even numbers collected in the list <code>evenNumbers</code>.</p>
  
  <p>Looking through the manual page on <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/-sequence/index.html" rel="nofollow noreferrer">Sequences</a>, I couldn't find anything that seemed to do this. Is there a way to achieve this in Kotlin?</p>