iex
06/09/2020, 4:09 PMResult
?bezrukov
06/09/2020, 4:14 PMval result = runCatching { some code }
iex
06/09/2020, 4:16 PMResult
class and came up with my own:
fun <T> toResult(f: () -> T): Result<T, Throwable> =
try {
Success(f())
} catch (t: Throwable) {
Failure(t)
}
bezrukov
06/09/2020, 4:24 PMinline
to avoid object/class creation for lambdaiex
06/09/2020, 4:30 PM