https://kotlinlang.org logo
#arrow-contributors
Title
# arrow-contributors
d

dnowak

06/10/2020, 12:50 PM
Hi guys, have you considered keeping
Try
?
'Try<out A>' is deprecated. Try will be deleted soon as it promotes eager execution of effects, so it's better if you work with Either's suspend constructors or an effect handler like IO
I do not think that its existence promotes eager execution of effects. This is how
Try
works and simetimes it is what you want. I tried to replace it with
Either.catch
but then I have to run it with
runBlocking
and it looks strange.
👍 1
🙏 1
r

raulraja

06/10/2020, 2:16 PM
Try promotes eager effects and it’s less efficient than try/catch which is also an expression. Try fires effect on it’s constructor which also calls Throwable.fillInStackTrace and that is indeed an effect
5 Views