dimforge / alga

Abstract algebra for Rust.
194 stars 39 forks source link

Fix some incorrect dependencies in `alga_derive` #101

Closed mark-schultz-wu closed 3 years ago

mark-schultz-wu commented 3 years ago

Three small changes. I was unable to get any of the tests in alga_derive_test to run (even before modifying things), but in my personal use case (implementing an integral domain, so in particular multiplication does not have two-sided inverses) I have expanded the macro #[alga_derive(RingCommutative(Additive, Multiplicative))] and it now behaves as expected.

The total changes are:

  1. Fix incorrect dependency of Monoid on Quasigroup and Loop on Semigroup
  2. Remove incorrect dependencies of Quasigroup/Loop on the second operation of CommutativeRing (which must only be a semigroup)
  3. Remove second instance of Ring on the second operation of CommutativeRing (it led to two AbstractRing definitions which were then conflicting).
sebcrozet commented 3 years ago

Thanks!