dropRight
Returns a lazy iterable that omits the last length values.
Lecture
dropRight omits the last length values instead
of the first. As with takeRight, there's no way to know
which elements are "last" without looking ahead, so it needs a finite
source. The sync version stays lazy, though: over a List it
indexes straight to the cut-off, and over any other iterable it holds a
small buffer of length elements and releases each value only
once length newer ones have arrived. It's the right tool when
you have, say, a known-size batch and want everything except a trailing
footer or sentinel.
fxDropRightAsync is different: it awaits the entire upstream
into a list before it can start producing values.
Demo 1 · Basics
Demo 2 · Async (must buffer the whole source first)
Try it yourself
Exercise: drop the last 2 footer lines.