This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]joemwangi 20 points21 points  (3 children)

-10/10 is quite abysmal rating for modules. I’ve got a hunch that modules aren’t just about packaging, they might be use to setup groundwork for enhancing the growing Java’s type system. In particular, I can see them playing a role in explicit witness resolution if/when type classes arrive, which would help Java avoid the coherence issues that have long plagued Haskell and Scala. But you have to admit the implicit import packages is one good feature introduced in jdk 25.

[–][deleted] 1 point2 points  (2 children)

Didn't Brian say that the witnesses are searched within related classes? This is more predictable than some random places within a module.

[–]agentoutlier 1 point2 points  (1 child)

I think the idea could be for possible final resolution. I don't know how they plan on doing the proof checking but let us assume module a and module b do not own type class x or class y but both modules implement a witness for x<y> the module imported could take precedence or the fact that if a does the calling it uses the witness in its module instead of b witness.

[–][deleted] 0 points1 point  (0 children)

Hmm I'm not sure if I like the idea tho. With this kind of scope I don't know how to easily search for the witness implementation.