algebra icon indicating copy to clipboard operation
algebra copied to clipboard

All operators should be parameterized for more general cases.

Open ghost opened this issue 8 years ago • 2 comments

Current approach are not suitable for more general algebras:

  1. Lattice consists of two semigroups, their operators have very similiar properties to each other and should not be assumed as additive-like nor multiplicative-like.

  2. Tensor product of modules consists of several different product-like operators, so I think all operators should be parameterized rather than be concrete instances.

A better approach might be letting all operators be parameterized through generics. For example:

pub trait Ring<Additive:Op, Multiplicative:Op>
    : RingApprox<Additive, Multiplicative>
    + GroupAbelian<Additive>
+ Monoid<Multiplicative>

instead of

pub trait Ring
    : RingApprox
    + GroupAbelian<Additive>
+ Monoid<Multiplicative>

ghost avatar Dec 30 '16 17:12 ghost

Hmm.. Yeah that makes sense. I am not actually sure how much this library will be developed as https://github.com/sebcrozet/alga has been developed more.

As you might have noticed development of both has been pretty slow...

WaDelma avatar Jan 12 '17 18:01 WaDelma

For what it's worth,the approach proposed here is actually the one implemented on alga!

sebcrozet avatar Jan 12 '17 23:01 sebcrozet