Skip to content

Commit 1b14c68

Browse files
committed
remove product implementation
1 parent b817db8 commit 1b14c68

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

jvm/src/test/scala/org/scalacheck/GenSpecification.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -323,19 +323,6 @@ object GenSpecification extends Properties("Gen") {
323323
}
324324
}
325325

326-
property("product") = forAll { (a: Int, b: Int, seeds: List[Seed]) =>
327-
val ga = Gen.choose(Int.MinValue, a)
328-
val gb = Gen.choose(Int.MinValue, b)
329-
330-
val prod1 = Gen.product(ga, gb)
331-
val prod2 = ga.flatMap { a => gb.map((a, _)) }
332-
333-
val params = Gen.Parameters.default
334-
seeds.forall { seed =>
335-
prod1.pureApply(params, seed) == prod2.pureApply(params, seed)
336-
}
337-
}
338-
339326
property("some") = forAll { n: Int =>
340327
forAll(some(n)) {
341328
case Some(m) => m == n

src/main/scala/org/scalacheck/Gen.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -501,19 +501,6 @@ object Gen extends GenArities{
501501
}
502502
}
503503

504-
/** Build a pair from two generators
505-
*/
506-
def product[A, B](ga: Gen[A], gb: Gen[B]): Gen[(A, B)] =
507-
gen[(A, B)] { (p: P, seed: Seed) =>
508-
val ra = ga.doApply(p, seed)
509-
ra.retrieve match {
510-
case None => r(None, ra.seed).copy(l = ra.labels)
511-
case Some(a) =>
512-
val rb = gb.doApply(p, ra.seed)
513-
rb.map((a, _)).copy(l = ra.labels | rb.labels)
514-
}
515-
}
516-
517504
/** Wraps a generator lazily. The given parameter is only evaluated once,
518505
* and not until the wrapper generator is evaluated. */
519506
def lzy[T](g: => Gen[T]): Gen[T] = {

0 commit comments

Comments
 (0)