https://kotlinlang.org logo
#feed
Title
# feed
u

uhe

01/30/2020, 8:30 AM
But you still can't use
kotlin.Result
as return type...
👍🏼 2
s

suresh

01/31/2020, 10:16 PM
@uhe what was the reasoning behind that restriction ?
j

janvladimirmostert

02/05/2020, 7:14 AM
i've started using Either in one project and i quite like that you can effectively throw an exception without the performance penalty, instead of
throw PEBKACError())
, it 's now just
Either.left(PEBKACError())
Optics is the next Arrow feature i'm slowly adding to this project
😍 1
d

doker

02/08/2020, 12:49 PM
@janvladimirmostert if you dont need stacktraces - disable them:
class FastException: Exception() { override fun fillInStackTrace() = null }
and 99.5% of performance penalty is magically gone. In many cases throwing such exception will perform almost like GOTO
👍 2
j

janvladimirmostert

02/08/2020, 12:50 PM
oh wow
If i don't know what the exception type is, then it would still be useful to have the stacktrace, but that's a really handy feature