Hi, which is the kotlin's approach to composing ac...
# codingconventions
a
Hi, which is the kotlin's approach to composing actions that may fail? Of course the actions may be suspended. I come from scala, so the "alternative" to
Either
alongside with
Future
and the
map
function. I've watched the presentations of Elizarov (which are excellent by the way), but couldn't imagine how to replace the
Either
. Thanks in advance.
t
Maybe something like https://github.com/michaelbull/kotlin-result is what you're looking for?
👍 1
a
I didn't know that library, I will take a look. Thank you. But I want to learn the kotlin way, the convention to achieve a single point of failure idiomatically
m
if you want
Either
you can use Arrow
a
I've read about Arrow. But it's API is unstable, the next version is 0.11. It looks very promising, but it's not production ready yet, that's why I'm looking for the idiomatic way.
m
I see, then I’m afraid there’s no alternative in the stdlib than to use Result (it’s not the same linked above).
👍 1