These are chat archives for non/algebra

27th
Nov 2017
Denis Rosset
@denisrosset
Nov 27 2017 14:03
@LukaJCB Am having a look now
I think you are missing the semigroup laws, for example associativity
Have a look here
On the other hand, I'm missing the distributive lattice stuff in Spire
(If you want to check the axioms, they are on Wikipedia. Anyway, it's a good idea to document where we pick the definitions.)
Luka Jacobowitz
@LukaJCB
Nov 27 2017 14:07
I made it so that they all extend from Band so the laws should be tested there
Denis Rosset
@denisrosset
Nov 27 2017 14:18
Ha! thanks, will check it out later
Denis Rosset
@denisrosset
Nov 27 2017 14:23
I see, we diverge on the use of bases. I made the choice of using only parents in my version of the laws. Would be happy to discuss about it.
In my understanding, the new laws style of cats is extremely straightforward at the price of some boilerplate and repetition. This is why I dumped the bases-type encoding.
For example, in the lattice laws, I duplicated the laws for the meet operation and for the join operation; then a lattice laws is simply the union of all these. It's then very easy to move from the typeclass, to the laws trait, and follow the inheritance chain.
However, by using bases, the relevant laws cannot be found by looking at the law traits; you have to go to the discipline implementation, and understand how things work together, which imho defeats the purpose of the new style. Any thoughts?
NB: would be happy to move this discussion to the GitHub PR. Feel free to cut'n'paste stuff there.
Luka Jacobowitz
@LukaJCB
Nov 27 2017 14:28
Interesting, I haven't put as much thought into it TBH
Denis Rosset
@denisrosset
Nov 27 2017 14:41
Can you enlighten me on the motivations of moving from the old laws (basically, everything in Discipline rule sets), and the new style?
Because what I wrote is pure speculation after comparing the code before/after
Luka Jacobowitz
@LukaJCB
Nov 27 2017 14:53
I'm sure someone from the cats side can give you a better answer
Luka Jacobowitz
@LukaJCB
Nov 27 2017 14:58
Tbh mostly it was just so cats kernel had the same law encoding as cats core
Denis Rosset
@denisrosset
Nov 27 2017 15:03
Oh I see