twitter/algebird — pull request #11 by echen (2012-08-20 11:08:44+00:00)
Title: Add boxed and unboxed Short rings and a Function1[T, T] monoid

Per Oscar's suggestion, I added:

* ShortRing, JShortRing
* Function1[T, T] monoid

I'm not really sure what the best way to write the ScalaCheck tests for the Function1 monoid is:

* For the generator, I generate linear functions f(x) = ax + b, where a and b are arbitrary integers. (I'm guessing there's nothing much better to do, besides add more types of functions?)
* To test function equality, I use `forAll { (n: Int) => monoidLawsEq[Function1[Int, Int]] { (f1, f2) => f1(n) == f2(n) } }`, but maybe what I should really have is something like `monoidLawsEq[Function1[Int, Int]] { (f1, f2) => forAll { (n: Int) => f1(n) == f2(n) } }` (i.e., I should perhaps switch quantifier scope)... Not sure.

So comments about that would be particularly helpful.