typelevel / algebra

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

Use macros to remove duplicate between tests and names #57

Closed non closed 9 years ago

non commented 9 years ago

Our tests have a lot of lines like these:

checkAll("List[Int]", OrderLaws[List[Int]].order)
checkAll("List[Int]", GroupLaws[List[Int]].monoid)
checkAll("List[String]", OrderLaws[List[String]].order)
checkAll("List[String]", GroupLaws[List[String]].monoid)

In addition to being annoyingly repetitive these calls introduce the very real possibility that the label and the actual code being run can be in disagrement.

It would be nice to use a macro (or similar) to remove the duplication.