You _can_ write in Java that very interface you claimed could not be written. interface ThrowingRunnable<E extends Throwable> { void run() throws E; } Only, hardly anybody writes it that way, so people forget that it's…
Scala 3 has enums, which can also serve as ADts: https://docs.scala-lang.org/scala3/reference/enums/enums.htm...
You _can_ write in Java that very interface you claimed could not be written. interface ThrowingRunnable<E extends Throwable> { void run() throws E; } Only, hardly anybody writes it that way, so people forget that it's…
Scala 3 has enums, which can also serve as ADts: https://docs.scala-lang.org/scala3/reference/enums/enums.htm...