Ifvwm
04/18/2021, 12:01 PMivanmorgillo
04/18/2021, 3:58 PMEither<E,A>
I guessraulraja
04/18/2021, 6:35 PMsuspend () -> A
More info here: https://arrow-kt.io/docs/effects/io/raulraja
04/18/2021, 6:36 PMinline
and they can be mixed transparently with suspendIfvwm
04/19/2021, 3:00 AMraulraja
04/19/2021, 6:11 AMIfvwm
04/19/2021, 9:26 AMKristian
04/19/2021, 4:42 PMsuspend Either.catch { throw Throwable("") }
in combination. Migrating from IO and IO.fx to suspend and Either was fairly straightforward in my experience. Removes the need for dealing with Throwables and nested IO<Either<Error, Unit>>
e.g:
suspend fun insert(val item: Item): Either<Error, Unit> =
either {
repo.save(item).bind()
}
Ifvwm
04/20/2021, 7:26 AMIfvwm
04/20/2021, 9:12 AM