typelevel / algebra

Experimental project to lay out basic algebra type classes
https://typelevel.org/algebra/
Other
378 stars 69 forks source link

Add tests for isCommutative/isIdempotent #36

Closed johnynek closed 9 years ago

johnynek commented 9 years ago

This also fixes duplicated semilattice tests by moving band and semilattice into GroupLaws.

On a side note, I'm not sure I see why we have XProperties rather than just some kind of general Properties instance. It means you can't compose inside LatticeLaws with GroupLaws. It feels a bit ad-hoc now since it is not clear where semilattice or band should go in the current picture.

I don't think it is critical, as it is just polishing the test code, but I thought I would mention my anxiety with my supportive colleagues.

non commented 9 years ago

So I think the use of path-dependent types in Discipline means that even if we just used Properties we can't share them between e.g. GroupLaws and LatticeLaws. Maybe @larsrh can speak to the design there? (And it's possible I'm just mistaken about that.)

To some degree I wrote the Rules generalization to make it easier to share this stuff between sets of Laws. I agree it feels a bit clunky right now.

johnynek commented 9 years ago

Got it. Not an issue, as I mentioned.

non commented 9 years ago

:+1:

larsrh commented 9 years ago

@johnynek That's what bases are good for – they allow you to pull in properties from a different hierarchy. I'm preparing a PR which fixes some misuses from #14 (my fault for not reviewing in time) and will also supersede this one. Sorry for the delay!