What is your opinion with this implementation of a...
# arrow
s
What is your opinion with this implementation of arrow with retrofit?
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()

// API
override fun getPosts(authToken: String): Either<Throwable, List<Post>> {
    return postsApi.getPosts(authToken).makeCall().map()
}

// PRESENTER
val result: Either<Throwable, List<Post>> = fx{
    val (result) = mPostsApi.getPosts(authToken)
    result
}