-
Notifications
You must be signed in to change notification settings - Fork 69
Names of operations of for semigroups, monoids, groups #131
Comments
In fact algebra considerably predates cats. Algebra started as a project In algebird we made the choice of Ring extending Group, and made the choice For algebird I had planned (but not thought too deeply) about making Having adapters is another approach but it makes it less convenient when it On Wed, Dec 9, 2015 at 05:49 Denis Rosset notifications@github.com wrote:
|
Thanks, I did not see the |
They have not been added. I think empty/combine actually came from scalaz But my current (not well thought out) plan is to add the methods. On Wednesday, December 9, 2015, Denis Rosset notifications@github.com
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin |
Okay, I found the discussion. It was an email thread with Avi, Erik, Lars, On Wed, Dec 9, 2015 at 8:25 AM, Tomas Mikula notifications@github.com
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin |
I'm OK with I'm less happy with All the monoid tutorials declare that the empty string But to write (Still, I don't want to revive a negotiation that already happen between the algebird and spire maintainers.) |
Well id is more often used in programming to be a short form of an identity is confused with the scala Predef.identity. There were no perfect choices, it seemed to us. On Thu, Dec 10, 2015 at 2:43 AM, Denis Rosset notifications@github.com
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin |
I don't mean to revive the negotiation either (I really don't dwell on names), but was |
It was not. ident was, but not too deeply. Honestly, we didn't bikeshed it too much. We had three libraries: scalaz: zero, append Spire folks didn't like zero so much. I didn't like "id" so much. neutral On Thu, Dec 10, 2015 at 8:18 AM, Tomas Mikula notifications@github.com
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin |
Not yet for Spire, it is still "id" in master. There is a PR in discussion for the merge with algebra, where "id" is going to be migrated to whatever algebra provides. I like very much "neutral", and the name is already used in a few algebra textbooks for a group "identity". (I don't know the status of "cats", and if they would agree on "neutral"). Still, I'd like a project named "algebra" to use names not too far away from the mathematical standards. In that view, "empty", "isEmpty" are quite misleading--- it is even worse with partial groups that have left and right identity elements, which would be named "leftEmpty", "rightEmpty", while "leftNeutral" is pretty straigtforward. |
Well now is the time to propose this. We are very near a release that we If you feel passionate about this, I'd recommend discussing it in the cats I hear you, and I like neutral better, but working in large code bases I am On Fri, Dec 11, 2015 at 12:29 AM, Denis Rosset notifications@github.com
P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin |
@johnynek Great that it's not too late! I should have been watching non/algebra more closely. I'm very much in favor of non/algebra not breaking binary compatibility, and avoiding fragmentation in client libraries. I'm now looking to the other typeclasses to see if I spot something unusual - coming from an abstract algebra viewpoint. (I just completed a PhD in physics, so my background is more on the theoretical physics/abstract algebra side). |
For the record: I prefer neutral over empty as well. As somebody without a math background, neutral seems very descriptive. I can not really estimate how many people would be affected by this change. Since neither algebird nor spire are using algebra atm, the biggest impact would be on cats. |
@non thoughts? I expect you understand Cats better. |
The feedback I got from cats' gitter is positive, I will propose a PR for the name change. |
sounds good. |
Renaming done in referenced PR. |
👍 |
That's an old issue, we went a different route. Going to put aliases in my group theory code. |
In algebra, the name of the associative operation is
combine
, the identity isempty
, the identity test isisEmpty
, while in spire, it isop
,id
andisId
.The
combine/empty
terminology is appropriate when concatenating data structures, whileop/id
is standard abstract algebra.The change came from e0ccca1 (thanks @rklaehn for finding it), and the compromise came probably from usage in cats --- but I was unable to find the discussion leading to the commit.
When basing spire on the algebra typeclasses, this notation is going to impact especially the people using
Group
in an algebraic setting.What should be done?
I see two options:
The text was updated successfully, but these errors were encountered: