Reputation: 11397
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?
Upvotes: 4
Views: 3492
Reputation: 14640
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.
Upvotes: 6