docs/data/it-coalesceseq.md
Returns the first non-empty sequence from the provided arguments, with a boolean indicating if a non-empty sequence was found.
emptySeq := func(yield func(int) bool) bool {
return false // empty sequence
}
nonEmptySeq := it.Range(3)
result, ok := it.CoalesceSeq(emptySeq, nonEmptySeq, emptySeq)
// iter.Seq[int] yielding 0, 1, 2, true
emptyStrSeq := func(yield func(string) bool) bool {
return false // empty sequence
}
strSeq := func(yield func(string) bool) bool {
yield("a")
yield("b")
return true
}
result, ok = it.CoalesceSeq(emptyStrSeq, strSeq)
// iter.Seq[string] yielding "a", "b", true
result, ok = it.CoalesceSeq(emptySeq, emptyStrSeq)
// nil sequence, false