twitter/algebird — pull request #10 by echen (2012-08-20 08:18:56+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

Note: I wasn't really sure what the best way to write the ScalaCheck tests for the Function1 monoid was:

* 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.