Class in arbitrary compiler

Gen

class Gen
Import
use arbitrary::{Gen};
Source: compiler/src/prelude/arbitrary.hy

A seeded source of random values. size bounds how big values get (ints in [-size, size], lengths up to size); coil test grows it from 0 so the first failures it finds are small.

Associated functions#

NameDescription
newA generator seeded with seed (0 is replaced by a fixed non-zero seed), starting at size 10.

Methods#

NameDescription
sizeThe current size bound.
resizeSets the size bound; negative sizes become 0.
bits32 random bits.
belowUniform in [0, n); 0 when n <= 0.
int_inUniform in [lo, hi].
one_inTrue one time in n.
lenHow many elements a collection gets: up to size, none once the value is nested deep().
depthHow deep the value being built is nested in others.
enterAround the parts of a value.
leaveUndoes one enter.
deepPast this depth derived enums stop nesting.

See also#

↑ ↓ navigate ↵ open