News for hackers. Stuff that matters.
Re:JEP draft: Exception handling in switch by mrkeen on Friday April 19, 2024 @03:55PM (#40091301)
> Foo foo() throws MyError

Why did you link to Kotlin? It doesn't appear to have `throws MyError`.

Re:JEP draft: Exception handling in switch by ackfoobar on Friday April 19, 2024 @04:05PM (#40091391)
You're right that was confusing.

For this line, where the same can be said for Java.

> Notice, that monad comprehension over Try monad is basically built into the Kotlin language.

Re:JEP draft: Exception handling in switch by bedobi on Friday April 19, 2024 @04:07PM (#40091413)
...which is even worse, because now the compiler is saying "when you call this, you will get this" and you have NO way of knowing that the call actually returns any number of exceptions, as a matter of course, without reading EVERY line called by EVERY line in that method

vs just plainly indicating you will get Either<Error, Foo>

Re:JEP draft: Exception handling in switch by wiseowise on Friday April 19, 2024 @06:24PM (#40092595)
What are you talking about? You literally can with sealed classes.
Re:JEP draft: Exception handling in switch by bedobi on Monday April 22, 2024 @04:30PM (#40119881)
I'm talking about the fact that every function call in Kotlin can return an exception (and it will always be undeclared, because Kotlin doesn't have checked exceptions)

this has nothing to do with sealed classes