3 ms·
Here's an example of a result type in Kotlin implemented as a library monad. (the language is getting an official one but is currently less featureful than this
by The_rationalist 6y ago
Here's an example of a result type in Kotlin implemented as a library monad. (the language is getting an official one but is currently less featureful than this lib)
You can use exception or Result depending on when it makes the most sense and this is the best of both worlds.
https://github.com/kittinunf/Result https://github.com/kittinunf/Result
- saagarjha 6y agoSwift had a bunch for a while too, but it’s getting an official one as well. Again, that’s only because the language provides the right tools for it to exist, in languages where you don’t have this you’re going to have a very hard time trying to add these things in.