Hacker News new | ask | show | jobs
by wizzwizz4 1034 days ago
In languages with a Result type (or Either monad), you basically do have checked exceptions, even though the language has no exceptions.
2 comments

With result types, you typically don’t get automatic exception propagation. I agree that overall it’s a spectrum of syntactic convenience, checked exceptions effectively form a sum type together with the regular return type.
Java also has that option. There is an excellent library called vavr. It adds the Try and Either monad to Java.