Open GeluOltean opened 3 years ago
Hi! Thank you for asking - yes, indeed, I plan to migrate to JDK17.
I'd love to help out with this!
Thank you! Please outline your idea here first, e.g.
Will do! Taking a closer look now, was waiting to clarify whether JDK17 is desired/planned.
Indeed, I was thinking about changes for Either, Option, Try and Validation. Will come back soon with a more detailed outline in a bit.
Great to hear! Thank you!
Hey @GeluOltean, do you have any updates on this?
Hey @bduisenov; got a bit overwhelmed by a previous project and did not manage to make much progress on this. It should be possible, but I do not have an idea yet of how extensive the changes would be.
@bduisenov @danieldietrich I'd be happy to take a crack at this, as I'm quite happy about Java introducing Pattern Matching and am eager for this.
The plan would be quite simple I think.
Either
, Option
, and Try
definitely would get the change. Validation
as well, if that is still being kept?Future
/Promise
I can still seal so they are closed for extension. They won't be relevant to Pattern Matching since there is only one sensible implementation, but I personally don't see a need to extend them or leave them open to extension either. Would defer to your thoughts/opinion/guidance on this, however.List
, Stream
, Tree
I would also be happy to include, though personally I won't find them as useful until Java would fully implement general deconstructionfinal
0.10.4
which I am used to working with, these are still interfaces, so I assume you had reasoning behind the move to abstract classes and I see no reason to roll that back.sealed
List.Cons
/Stream.Cons
and Stream.Empty
/Tree.Empty
public abstract sealed
, and the concrete classes are already public static final
.
Stream
is a special case with slightly different hierarchy, since Stream.Cons
is abstract
and implemented by two private static final
inner classes. So I would seal Stream.Cons
as well, while keeping the implementations private (I would say nobody needs to know what kind of Cons
it is, no?)build.gradle
\ The only real issue I see here (from my understanding) is the fact that #2346 will be blocking this due to the Java version update.
Hey everyone!
Considering JDK17 is a LTS version and the sealed class feature being production ready with its release, are there any plans regarding using this feature for defining parametric algebraic data types? Being able to use switch expressions to pattern match would be great for developer experience.
Not sure if using JDK17 would be out of scope for now or not, hence the issue.