News for hackers. Stuff that matters.
Re:What I miss in Java, the perspective of a Kotlin developer by qsort on Tuesday June 14, 2022 @05:27AM (#31736514)
Big fan of that approach as well, but there's no reason why you can't do it in Java. Records and streams are your friends. It's actually rather straightforward to start from a neat, functional pipeline and then do whatever at the edge.

Of course you can't have the pure/impure distinction enforced, but nothing that isn't a purely functional language is going to give you that.

The only really dumb limitation is that you can't have freestanding functions, but that's aesthetics more than substance.

Re:What I miss in Java, the perspective of a Kotlin developer by kaba0 on Tuesday June 14, 2022 @06:40AM (#31737008)
It won’t make Java into Haskell, but just as an interesting tidbit, Checker Framework can check besides null-safety, pureness as well by annotations.
Re:What I miss in Java, the perspective of a Kotlin developer by pharmakom on Tuesday June 14, 2022 @07:35AM (#31737594)
The lack of currying and do-notation really hurts.