myanmarking
02/03/2020, 3:52 PMsatyan
02/03/2020, 3:55 PMsatyan
02/03/2020, 3:55 PMThe rationale behind these limitations is that future versions of Kotlin may expand and/or change semantics of functions that returntype and null-safety operators may change their semantics when used on values ofResult
type. In order to avoid breaking existing code in the future releases of Kotlin and leave door open for those changes, the corresponding uses produce an error now. Exceptions to this rule are made for carefully-reviewed declarations in the standard library that are part of theResult
type API itself.Result
myanmarking
02/03/2020, 3:57 PMmyanmarking
02/03/2020, 3:57 PMMike
02/03/2020, 3:58 PMAhmed Ibrahim
02/03/2020, 4:21 PMEither
, and has similar API to kotlin.Result
, I've been using it and it served me well.
https://github.com/npryce/result4kCzar
02/03/2020, 5:18 PMkotlin.Result
if you specify
-Xallow-result-return-type
in compiler args. It's experimental though and the way it works and its API could change before it completes its experimental stage, that's why it isn't enabled by default.Mike
02/03/2020, 6:39 PMEither
in Arrow (becoming BIO in 0.11 release) is a good place to start if you want to really get into FP. If you just want the Result type, then result4k looks like a very good option. Or opting into experimental.