RFR: 8376223: Add modeling interfaces for algebraic structures: groups, rings, and fields
Joe Darcy
darcy at openjdk.org
Fri Jan 23 20:38:49 UTC 2026
On Fri, 23 Jan 2026 20:29:23 GMT, Brian Goetz <briangoetz at openjdk.org> wrote:
> I think we'll find that the return on modeling the algebraic structures directly is less than we might think, because real-world numeric types like Integer and Float aren't actually rings or fields. (Haskell has these classes, but it keeps their operations separate from the mathematical operators; while `Num` declares `(+)` and `(*)`, `Monoid` declares `mzero` and `mappend`. But the logical conclusion of this is that they are not all that useful to numerics at all, and I expect they will not carry their weight in the end.)
Note 32-bit int arithmetic is a ring -- Integer.MIN_VALUE is its own additive inverse.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1957#issuecomment-3792296477
More information about the valhalla-dev
mailing list