trait MonadGenOps[M[_]] extends AnyRef
- Alphabetic
- By Inheritance
- MonadGenOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
discard[A](implicit G: MonadGen[M]): M[A]
Discards the whole generator.
-
def
ensure[A](gen: M[A], p: (A) ⇒ Boolean)(implicit F: Monad[M], G: MonadGen[M]): M[A]
Discards the generator if the generated value does not satisfy the predicate.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
filter[A](gen: M[A])(p: (A) ⇒ Boolean)(implicit F: Monad[M], G: MonadGen[M]): M[A]
Generates a value that satisfies a predicate.
Generates a value that satisfies a predicate.
We keep some state to avoid looping forever. If we trigger these limits then the whole generator is discarded.
-
def
fromSome[A](gen: M[Option[A]])(implicit F: Monad[M], G: MonadGen[M]): M[A]
Runs a
Option
generator until it produces aSome
.Runs a
Option
generator until it produces aSome
.This is implemented using
filter
and has the same caveats. -
def
generate[A](f: (Size, Seed) ⇒ (Seed, A))(implicit G: MonadGen[M]): M[A]
Construct a generator that depends on the size parameter.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
integral[A](range: Range[A], fromLong: (Long) ⇒ A)(implicit arg0: Integral[A], F: MonadGen[M]): M[A]
Generates a random integral number in the given
[inclusive,inclusive]
range.Generates a random integral number in the given
[inclusive,inclusive]
range.When the generator tries to shrink, it will shrink towards the Range.origin of the specified Range.
For example, the following generator will produce a number between
1970
and2100
, but will shrink towards2000
:Gen.integral(Range.constantFrom(2000, 1970, 2100))
Some sample outputs from this generator might look like:
=== Outcome === 1973 === Shrinks === 2000 1987 1980 1976 1974 === Outcome === 2061 === Shrinks === 2000 2031 2046 2054 2058 2060
-
def
integral_[A](range: Range[A], fromLong: (Long) ⇒ A)(implicit G: MonadGen[M], I: Integral[A]): M[A]
Generates a random integral number in the
[inclusive,inclusive]
range.Generates a random integral number in the
[inclusive,inclusive]
range.This generator does not shrink.
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
list[A](gen: M[A], range: Range[Int])(implicit F: Monad[M], G: MonadGen[M]): M[List[A]]
Generates a list using a 'Range' to determine the length.
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
sized[A](f: (Size) ⇒ M[A])(implicit F: Monad[M], G: MonadGen[M]): M[A]
Construct a generator that depends on the size parameter.
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
Deprecated Value Members
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.