Krystian Rybarczyk
09/30/2020, 8:58 AMBIO
? I have seen a commit by @simon.vergauwen merged into arrow-fx and then I’ve seen it reverted. Is there a rational somewhere on GitHub maybe that I could go through? Or maybe someone would not mind explaining real quick what happened there? 🙂stojan
09/30/2020, 9:07 AMIO<A>
is now suspend fun blah(): A
(because of suspend, there is an implicit possibility to fail with Throwable
)
that means that instead of IO<E, A>
you can use: suspend fun blah(): Either<A, B>
raulraja
09/30/2020, 9:53 AMKrystian Rybarczyk
09/30/2020, 9:57 AMEither.fx {
someComputationThatThrowsExc()
}
having tried that I noticed that fx
is depracted in favour of simply either {}
. In other places though (e.g. docs: https://arrow-kt.io/docs/integrations/kotlinxcoroutines/ )
I found Either.catch{}
being used. What confuses me is that
Either.catch {
someComputationThatThrowsExc()
}
is safe to use (catches the exception and wraps it into Left(Exception)
, whereas either{}
simply propagates the exception. Any reason for the difference in behaviour? Should I prefer one over the other?raulraja
09/30/2020, 10:02 AMraulraja
09/30/2020, 10:03 AMKrystian Rybarczyk
09/30/2020, 10:03 AMEither.catch
?raulraja
09/30/2020, 10:04 AMraulraja
09/30/2020, 10:05 AMKrystian Rybarczyk
09/30/2020, 10:05 AMraulraja
09/30/2020, 10:06 AMraulraja
09/30/2020, 10:06 AMKrystian Rybarczyk
09/30/2020, 10:13 AMKrystian Rybarczyk
09/30/2020, 11:05 AMraulraja
09/30/2020, 11:06 AMraulraja
09/30/2020, 11:06 AMraulraja
09/30/2020, 11:07 AMKrystian Rybarczyk
09/30/2020, 11:19 AMKrystian Rybarczyk
09/30/2020, 2:22 PMbracket()
. What about suspend Either
?stojan
09/30/2020, 3:00 PMKrystian Rybarczyk
09/30/2020, 4:24 PMstojan
09/30/2020, 5:52 PMstojan
09/30/2020, 5:53 PMstojan
09/30/2020, 5:53 PMraulraja
09/30/2020, 10:18 PMraulraja
09/30/2020, 10:19 PMKrystian Rybarczyk
10/01/2020, 6:18 AM