y
10/18/2022, 8:39 AMResult
in Kotlin, and is it idiomatic to use it? do failible functions in Kotlin generally return error types on failure, throw, or just return `null`/silently exit?Sam
10/18/2022, 8:45 AMSam
10/18/2022, 8:45 AMResult<T, E>
type in the stdlib (there is a Result<T>
but it’s really for different things). I’d start with the Either<E, T>
type from #arrow, but as mentioned in the linked article it’s easy enough to create your own sealed types too.Sam
10/18/2022, 8:49 AMkuzuha
10/18/2022, 8:50 AMy
10/18/2022, 8:59 AMtryDoingThing()
?y
10/18/2022, 8:59 AMkuzuha
10/18/2022, 9:01 AMSam
10/18/2022, 9:04 AMSam
10/18/2022, 9:04 AMMichael de Kaste
10/18/2022, 9:04 AMy
10/18/2022, 9:07 AMy
10/18/2022, 9:08 AMy
10/18/2022, 9:08 AMMichael de Kaste
10/18/2022, 9:11 AMy
10/18/2022, 9:12 AMResult<T, E>
y
10/18/2022, 9:13 AMkuzuha
10/18/2022, 9:13 AMkuzuha
10/18/2022, 9:13 AMy
10/18/2022, 9:14 AMgildor
10/25/2022, 3:56 PM