I have a Stream[A]
and a function zeroOrMoreB(value: A): Seq[B]
which given an A
returns zero or more B
. From these two pieces, how to I construct a Stream[B]
?
I can get a Stream[Stream[B]]
(see below), but I cannot figure out how to flatten it.
stream <- ZStream
.fromIterable(vectorOfAs)
.map(zeroOrMoreB)