Java 8 didn't provide Try monad. Which is useful for exception handling in functional style.
Is there any ready implementation in kotlin? or shall i implement one?
Unfortunately there is no Try monad in Kotlin standard library. I'm just learning FP, but i think sealed class is what you needed to implement Try monad yourself. Also there are some libraries: Result and funKTionale.
Upd. Feb 2018
Now funKTionale and Kategory merged into arrow library, which has Try monad.
Since kotlin 1.3 you can use runCatching
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With