News for hackers. Stuff that matters.
Re:The problem with new URL(), and how URL.parse() fixes that by kaba0 on Tuesday May 21, 2024 @12:54AM (#40424295)
> I don't understand what this means. If you wrap an exception and throw it, how has your function become responsible for the failure?

That’s a declaration that this specific kind of problem (say, an IOException) can be handled as this other, higher-level exception (say, of type MyApplicationException, that when bubbles up, will display a friendly error dialog to the user, and logs the underlying IOException for the devs).

> checked exceptions are fundamentally incompatible with [..] higher order functions and polymorphism

They aren’t. Look into languages with algebraic effects.

Re:The problem with new URL(), and how URL.parse() fixes that by wvenable on Tuesday May 21, 2024 @01:46AM (#40424604)
Maybe I know how to handle IOException but not MyApplicationException but the method only gives me the latter. There is effectively no handling MyApplicationException so why even force the declaration. Either way most exceptions cannot be handled in any meaningful way anyway so checked exceptions are pointless busywork.

> They aren’t. Look into languages with algebraic effects.

Can you give me more to go on than that?