I am experimenting with BIO, may be a basic questi...
# arrow
g
I am experimenting with BIO, may be a basic question, is there a way to get
IO<Throwable, Int>
from which I can get
Either<Throwable, Int>
in the scenario below. (using
attempt()
gives me
Either<Nothing, Either<Throwable, Int>>
)
Copy code
@Test
    fun `BIO with Exception`() {
        val bio: IO<Nothing, Int> = IO { if (trueForEver()) throw RuntimeException("error") else 1 }
        println(bio.unsafeRunSyncEither())
    }
The above code throws exception as expected