@@ -83,10 +83,6 @@ sealed abstract class Gen[+T] extends Serializable { self =>
8383 rt.flatMap(t => f(t).doApply(p, rt.seed))
8484 }
8585
86- @ deprecated(" Empty generators are discouraged." , " 1.14.0" )
87- def flatten [U ](implicit asOption : T => Option [U ]): Gen [U ] =
88- map(asOption).collect{ case Some (t) => t }
89-
9086 /** Create a new generator that uses this generator to produce a value
9187 * that fulfills the given condition. If the condition is not fulfilled,
9288 * the generator fails (returns None). Also, make sure that the provided
@@ -99,13 +95,6 @@ sealed abstract class Gen[+T] extends Serializable { self =>
9995 * test property is side-effect free, eg it should not use external vars. */
10096 def filterNot (p : T => Boolean ): Gen [T ] = suchThat(x => ! p(x))
10197
102- /** Create a new generator that fails if the specified partial function
103- * is undefined for this generator's value, otherwise returns the result
104- * of the partial function applied to this generator's value. */
105- @ deprecated(" Empty generators are discouraged." , " 1.14.0" )
106- def collect [U ](pf : PartialFunction [T ,U ]): Gen [U ] =
107- flatMap { t => Gen .fromOption(pf.lift(t)) }
108-
10998 /** Creates a non-strict filtered version of this generator. */
11099 def withFilter (p : T => Boolean ): WithFilter = new WithFilter (p)
111100
@@ -446,14 +435,6 @@ object Gen extends GenArities{
446435 val seed = seed0
447436 }
448437
449- /** A generator that fails if the provided option value is undefined,
450- * otherwise just returns the value. */
451- @ deprecated(" Empty generators are discouraged." , " 1.14.0" )
452- def fromOption [T ](o : Option [T ]): Gen [T ] = o match {
453- case Some (t) => const(t)
454- case None => fail
455- }
456-
457438 /** A generator that generates a random value in the given (inclusive)
458439 * range. If the range is invalid, the generator will not generate
459440 * any value. */
@@ -514,12 +495,6 @@ object Gen extends GenArities{
514495 gen { (p, seed) => h.doApply(p, seed) }
515496 }
516497
517- /** Wraps a generator for later evaluation. The given parameter is
518- * evaluated each time the wrapper generator is evaluated.
519- * This has been deprecated in favor of [[org.scalacheck.Gen.delay ]]. */
520- @ deprecated(" Replaced with delay()" , " 1.13.0" )
521- def wrap [T ](g : => Gen [T ]): Gen [T ] = delay(g)
522-
523498 /** Wraps a generator for later evaluation. The given parameter is
524499 * evaluated each time the wrapper generator is evaluated. */
525500 def delay [T ](g : => Gen [T ]): Gen [T ] =
0 commit comments