I'm looking for a way to generate a scala stream (the equivalent of F#'s sequence) of this form:
let allRows resultSet : seq<Row> =
seq {
while resultSet.next() do
yield new Row(resultSet)
}
Is there any way to easily do this in scala? The only way I found involved (non-tailrecursive) recursion, which for large amounts of rows in a resultSet
would mean certain stackoverflow.
Thanks