Hi, for using arrow-core-retrofit integration on 0...
# arrow
h
Hi, for using arrow-core-retrofit integration on 0.11.0-SNAPSHOT I have: (left is Unit bec. I will never have body there)
Copy code
@GET("foo")
  suspend fun getFoo(
    @Query("param") param: String
  ): Either<Unit, FooDto>
and helper (ideally unnecessary) method:
Copy code
fun notGonnaHappenError(): Throwable = TODO()
How to return
Either<DomainError, FooDto>
? I have this method:
Copy code
private suspend fun getFoo(param: Bar): Either<DomainError, FooDto> =
    Either.catch { client.getFoo(param.value).mapLeft { notGonnaHappenError() } }
      .flatten()
      .mapLeft { DomainError(it) }
But I think it’s not as beautiful as it can be…
s
drop the
Either
Copy code
suspend fun getFoo(): FooDto
natively supported by retrofit
also... technically
Nothing
is the correct type for "this can't happen"
h
Yyyym yep, too much fp…

https://www.youtube.com/watch?v=WCOgA4Tvu1k

thx
😂 1