Hi, I'm learning Arrow for Android Development and...
# arrow
a
Hi, I'm learning Arrow for Android Development and I got stuck on how to integrate arrow with ktor? How exactly can I run my suspend functions? Do I just:
Copy code
suspend fun someApi(): IO<SomeObject> {
    return IO.effect {         
        ktorClient.get("<http://someendpoint.com>") 
    }
}
May I ask for some guidance?
r
You have
io.suspended()
which turns
IO<A>
into
suspend () -> A
in your case if `
Copy code
ktorClient.get("<http://someendpoint.com>")
requires suspension you can use IO.effect
to compose it with other IO actions but in that particular function you can just use:
Copy code
suspend fun someApi(): SomeObject =
  ktorClient.get("<http://someendpoint.com>")