``` IO.tailRecM(emptyList<A>()) { list ->...
# arrow
p
Copy code
IO.tailRecM(emptyList<A>()) { list ->
  IO.fx {
    val (hasNext) = rs.hasNext()
    if (hasNext) {
      val (t) = mapper(rs)
      Left(t.prependTo(list))
    } else {
      Right(list)
    }
  }
}