diff --git a/src/main/scala/org/scalacheck/Cogen.scala b/src/main/scala/org/scalacheck/Cogen.scala index 211bb486b..f52875254 100644 --- a/src/main/scala/org/scalacheck/Cogen.scala +++ b/src/main/scala/org/scalacheck/Cogen.scala @@ -167,6 +167,8 @@ object Cogen extends CogenArities with CogenLowPriority with CogenVersionSpecifi while (i < as.length) { s = A.perturb(s, as(i)); i += 1 } s.next } + + def domainOf[A, B](f: A => B)(implicit B: Cogen[B]): Cogen[A] = B.contramap(f) } trait CogenLowPriority {