arrow-fx-coroutines / arrow.fx.coroutines.stream / ResourceOps / lastOrError

lastOrError

suspend fun lastOrError(): Resource<O>

Compiles this stream in to a value, raising a NoSuchElementException if the stream emitted no values and returning the last value emitted otherwise.

When this method has returned, the stream has not begun execution – this method simply compiles the stream down to the target effect type.

Do you like Arrow?

Arrow Org
<