These are chat archives for non/algebra

3rd
Nov 2017
Luka Jacobowitz
@LukaJCB
Nov 03 2017 13:36
So I’m trying to port the Algebra laws to the new cats style laws and I’m a bit confused about how the LatticeProperties work, maybe someone can help me out?
@johnynek ? :D
Denis Rosset
@denisrosset
Nov 03 2017 13:50
I can chime in.
@LukaJCB as a start, look at "Lattices as algebraic structures" in https://en.wikipedia.org/wiki/Lattice_(order)
Otherwise, just prepare the PR with stubs for the Lattice stuff, and I'll try to complete.
Thanks for helping! I'd like to move Spire to cats 1.0.0 as well!
Luka Jacobowitz
@LukaJCB
Nov 03 2017 13:55
Okay, I guess my actual question is, should the MeetSemilatticeLaws inherit the SemilatticeLaws?
Luka Jacobowitz
@LukaJCB
Nov 03 2017 14:04
And analogously the BoundedMeetSemiLatticeLaws from the BoundedSemilatticeLaws
Denis Rosset
@denisrosset
Nov 03 2017 17:05
Not exactly
A semilattice is defined as a specialized semigroup, basically it's commutative and idempotent, i.e. `x |+| y |+| y = x |+| y` and `x |+| x |+| y = x |+| y`
A meet semilattice is completely equivalent to a semilattice, except that its operation is called "meet".
A join semilattice is completely equivalent to a semilattice, except that its operation is called "join".
A lattice is both a meet and join semilattice (that's why we define join and meet semilattices)
Think of it the same way as a ring: it has both an additive and multiplicative monoid inside, but they are not the same, so `Ring[A]` does not directly inherit from `Monoid[A]`, but rather `AdditiveMonoid[A]` (or actually `AdditiveGroup[A]`), and `MultiplicativeMonoid[A]`
(the additive monoid in a ring is always commutative, and the multiplicative monoid can be commutative if it is a commutative ring; a field is actually a multiplicative group over nonzero elements, but you get the spirit)
So I suggest, for the tests, to write them in the same way for the semilattice stuff and the ring stuff
Luka Jacobowitz
@LukaJCB
Nov 03 2017 17:47
Okay I might create a PR with the Lattice stuff, and then when we find the solution I can apply it to ring as well :+1: