Skip to content

Instantly share code, notes, and snippets.

View axel22's full-sized avatar

Aleksandar Prokopec axel22

View GitHub Profile
object Generators {
/** Given as an example of how to combine 2 generators. */
val pairs: Generator[(Int, Int)] = for {
x <- integers
y <- integers
@axel22
axel22 / gist:7300277
Created November 4, 2013 09:39
Example of specialized HMap, where equality and array instantiation is factored out into a typeclass.
import scala.reflect.ClassTag
class HMap[@specialized(Int, Long) K, V](
implicit val emptyKey: HMap.Empty[K],
implicit val emptyVal: HMap.Empty[V]
import org.scalameter.api._
object MyRangeTest extends PerformanceTest.Regression {
override def reporter: Reporter = Reporter.Composite(
new RegressionReporter(
RegressionReporter.Tester.Accepter(),
RegressionReporter.Historian.Complete()),
HtmlReporter(embedDsv = true)
)