non/spire — pull request #54 by larsrh (2013-01-19 23:05:42+00:00)
Title: Law checking for algebraic structures

This pull request adds easy law checking for instances of the following type classes:

* `Semigroup`, `Monoid`, `Group`, `AbGroup`
* their additive and multiplicative variants
* `Semiring`, `Rng`, `Rig`, `Ring`, `EuclideanRing`, `Field`

Hopefully, the laws for up to `AbGroup` are complete. For the rest, I'm sure that there are some missing. For `EuclideanRing`, I'm not even sure whether those make sense :)

Adding more tests is as easy as adding one line in `LawTests.scala`. They even get meaningful names!

In order to integrate better into the library, I used spire's `Eq` to compare for equality instead of the `===` provided by ScalaTest. I hope that's okay.

The version in this pull request passes all tests.