News for hackers. Stuff that matters.
Re:A new approach to error handling by kaba0 on Tuesday July 30, 2024 @04:18PM (#41113705)
It still can have it, see e.g. Vavr, or other functional libraries.

Edit: Not sure why the downvote.

This works in Java today with proper pattern matching (I left out the complete name from the permit clause, it won’t compile as is):

  sealed interface <T,E> Result permits Ok, Error {
    record Ok(T val) implements Result<T,E> {}
    record Error(E err) implements Result<T,E> {}
  }
Re:A new approach to error handling by mrkeen on Tuesday July 30, 2024 @05:56PM (#41114518)
Man I hope Vavr survives. It is an oasis of rationality and I'm disheartened that https://docs.vavr.io/ appears to be down. Its Set implementation actually has union and intersection (!!!)
Re:A new approach to error handling by Yoric on Wednesday July 31, 2024 @03:54AM (#41117180)
Sure, but by now, the ship has long sailed, it's unlikely that many people will start adopting this style.