If Scala 3.1 adopts checked exceptions, I'm looking forward to the day when I can declare a library method as, def foo: Bar throws E without worrying whether my users care about exceptions or not. Right now I must return either `Bar` or `Try[Bar]` and make _someone_ compromise.
-
-
And what if you want to write a "let-it-fail" prototype but might want to make it safe later? The best part is that most of the code wouldn't change: no need to switch to for-comprehension style. Either you wrap the expression in try/catch, or declare its return type as throwing.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.