-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Semifield
and CommutativeSemifield
to algebra
#3979
Conversation
@johnynek would you mind reviewing this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Are there examples you have in mind that are not other structures?
Are there any instances we can create that we couldn't fully express before?
@johnynek Thanks for the review! I'm using semifields for non-negative reals in my probabilistic programming library, where probabilities are added, multiplied, and divided (but never negative). For example, I have a Not sure if this is anything we can add to Algebra itself. |
I can't restart the microsite build. Can you push again? I want to make sure it was a flake. |
Absolutely. But this was a known issue, see #3974 (comment) |
@johnynek good to go. |
Thank you @armanbilge & @johnynek for adding I'm guessing the algebra type-classes must sometimes feel obscure and even that no one notices/appreciates the work. So I thought I'd share my story.. Having defined a non-negative sub-species of On docs, I do think an extra two rows are needed in the Ring table. But then it further qualifies the statement that "every lower structure is also an instance of the structures above it"; I actually wonder if with another two exceptions, that over-generalization has gone past time? |
Thanks!
Indeed!
Yes, agree, probably an inheritance diagram would be more useful at this point :) (in addition to the existing table.) |
Update Ring-like table in Algebra for Semifield added in #3979
Introduces a
Semifield
andCommutativeSemifield
to algebra. I'm going by the second definition on Wikipedia:Thanks in advance!