Functional exception handling


#1

As far as I know functional exception handling is not part of the Kotlin standard library tody. I’d like to have something like Scala`s Try class to represent success or failure with a type. There are some third-party approaches (like Result), but I think that should be part of the standard library. Kotlin is a nice functional programming language and such a construct would help to handle errors in a functional way.

What do you think?


#2

You are welcome to take a look at this issue: https://youtrack.jetbrains.com/issue/KT-18608 that covers potential Result type in Kotlin stdlib. Currently, it is narrowly targeted to cover asynchronous use-cases and thus has a minimal API. However if you have any specific use-cases for a richer API, then we’d appreciate if you add them to the issue.


#3

Thank you, I’ll have a look.