https://kotlinlang.org logo
#arrow
Title
# arrow
s

simon.vergauwen

05/08/2019, 8:39 AM
Copy code
fun <R> CallK<R>.makeCall(): IO<Response<R>> =
    this.async(IO.async()) // Kind<ForIO, Response<R>>
        .fix() // IO<Response<R>>

fun <T> IO<Response<T>>.map(): Either<Throwable, T> =
    unsafeRunSync()
        .unwrapBody(Either.applicativeError())
        .fix()