ghedeon
10/17/2019, 2:39 PMEither/Try/Result
If you go b)
, since you can't use kotlin Result
type, do you bring Arrow for that? Do you create your custom Either/Try/Result
? How does it look like?Pablichjenkov
10/17/2019, 6:27 PMonErrorReturn
, onErrorResumeNext()
kind of operators to convert the Exceptions into something I can handler easier.
Also I don't like the fact of having the 2 streams(Success and Failure) separate.
What do you mean by:
since you can't use kotlin Result?What stops you?
ursus
10/18/2019, 3:08 AMghedeon
10/18/2019, 5:46 AMResult
forbidden as return type?
@ursus Why not happy? Too easy to forget to handle the exception?ursus
10/18/2019, 5:47 AMghedeon
10/18/2019, 6:00 AM@Throws
annotation, but it's more for interop tho.. Funny, that Swift decided to go with checked exceptions and Kotlin removed them 🙂.ursus
10/18/2019, 6:30 AMursus
10/18/2019, 6:33 AMPablichjenkov
10/18/2019, 2:21 PMPablichjenkov
10/18/2019, 2:23 PMPablichjenkov
10/18/2019, 2:30 PM-Xallow-result-return-type
if you want to use it experimentalmattinger
10/18/2019, 3:08 PMrunCatching {
blahblah()
}.toTry()
ursus
10/18/2019, 4:23 PMAl Warren
10/18/2019, 4:51 PM"Also not happy about when(result) everywhere"I don't mind calls to when. Ideally, you'd only need them at some terminal location. When used properly with something like a sealed class, it becomes very verbose and easy to read. My philosophy is that whenever we encounter an error, ultimate something needs to be passed back so that the user can make a decision about what to do next. After a lot of thought and trial and error, I wrote a short blog post on that reasoning. https://ntxdroid.com/we-are-in-flight
mattinger
10/18/2019, 5:57 PMursus
10/18/2019, 5:58 PMursus
10/18/2019, 10:41 PMursus
10/19/2019, 2:29 AM