# Generators
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-318)</span>

Convenience combinators and factories for common types and kind of Generators.


```pony
primitive val Generators
```

## Constructors

### create
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-318)</span>


```pony
new val create()
: Generators val^
```

#### Returns

* [Generators](pony_check-Generators.md) val^

---

## Public Functions

### unit\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-323)</span>


Generate a reference to the same value over and over again.

This reference will be of type `box->T` and not just `T`
as this generator will need to keep a reference to the given value.


```pony
fun box unit[T: T](
  t: T,
  do_shrink: Bool val = false)
: Generator[box->T] box
```
#### Parameters

*   t: T
*   do_shrink: [Bool](builtin-Bool.md) val = false

#### Returns

* [Generator](pony_check-Generator.md)\[box->T\] box

---

### none\[T: [None](builtin-None.md) val\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-341)</span>


```pony
fun box none[T: None val]()
: Generator[(T | None val)] box
```

#### Returns

* [Generator](pony_check-Generator.md)\[(T | [None](builtin-None.md) val)\] box

---

### repeatedly\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-344)</span>


Generate values by calling the lambda `f` repeatedly,
once for every invocation of `generate`.

`f` needs to return an ephemeral type `T^`, that means
in most cases it needs to consume its returned value.
Otherwise we would end up with
an alias for `T` which is `T!`.
(e.g. `String iso` would be returned as `String iso!`,
which aliases as a `String tag`).

Example:

```pony
Generators.repeatedly[Writer]({(): Writer^ =>
  let writer = Writer.>write("consume me, please")
  consume writer
})
```


```pony
fun box repeatedly[T: T](
  f: {(): T^ ?}[T] box)
: Generator[T] box
```
#### Parameters

*   f: {(): T^ ?}[T] box

#### Returns

* [Generator](pony_check-Generator.md)\[T\] box

---

### seq_of\[T: T, S: [Seq](builtin-Seq.md)\[T\] ref\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-371)</span>


Create a `Seq` from the values of the given Generator
with size in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box seq_of[T: T, S: Seq[T] ref](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[S] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[S\] box

---

### iso_seq_of\[T: [Any](builtin-Any.md) #send, S: [Seq](builtin-Seq.md)\[T\] iso\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-412)</span>


Generate a `Seq[T]` where `T` must be sendable (i.e. it must have a
reference capability of either `tag`, `val`, or `iso`).

The constraint of the elements being sendable stems from the fact that
there is no other way to populate the iso seq if the elements might be
non-sendable (i.e. ref), as then the seq would leak references via
its elements.

Size is in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box iso_seq_of[T: Any #send, S: Seq[T] iso](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[S] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[S\] box

---

### array_of\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-471)</span>


```pony
fun box array_of[T: T](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[Array[T] ref] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[Array](builtin-Array.md)\[T\] ref\] box

---

### shuffled_array_gen\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-479)</span>


```pony
fun box shuffled_array_gen[T: T](
  gen: Generator[Array[T] ref] box)
: Generator[Array[T] ref] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[[Array](builtin-Array.md)\[T\] ref\] box

#### Returns

* [Generator](pony_check-Generator.md)\[[Array](builtin-Array.md)\[T\] ref\] box

---

### shuffled_iter\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-500)</span>


```pony
fun box shuffled_iter[T: T](
  array: Array[T] ref)
: Generator[Iterator[this->T!] ref] box
```
#### Parameters

*   array: [Array](builtin-Array.md)\[T\] ref

#### Returns

* [Generator](pony_check-Generator.md)\[[Iterator](builtin-Iterator.md)\[this->T!\] ref\] box

---

### list_of\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-510)</span>


```pony
fun box list_of[T: T](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[List[T] ref] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[List](collections-List.md)\[T\] ref\] box

---

### set_of\[T: ([Hashable](collections-Hashable.md) #read & [Equatable](builtin-Equatable.md)\[T\] #read)\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-518)</span>


Create a generator for `Set` filled with values
of the given generator `gen`
with insertion attempts in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

The returned sets can have fewer elements than the lower bound
when the source generator `gen` produces duplicates.
E.g. if the given generator is for `U8` values and the upper bound
is set to 1024, the set will only ever be of size 256.


```pony
fun box set_of[T: (Hashable #read & Equatable[T] #read)](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[Set[T]] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[Set](collections-Set.md)\[T\]\] box

---

### set_is_of\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-561)</span>


Create a generator for `SetIs` filled with values
of the given generator `gen`
with insertion attempts in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

The returned sets can have fewer elements than the lower bound
when the source generator `gen` produces duplicates.
E.g. if the given generator is for `U8` values and the upper bound
is set to 1024, the set will only ever be of size 256.


```pony
fun box set_is_of[T: T](
  gen: Generator[T] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[SetIs[T]] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[T\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[SetIs](collections-SetIs.md)\[T\]\] box

---

### map_of\[K: ([Hashable](collections-Hashable.md) #read & [Equatable](builtin-Equatable.md)\[K\] #read), V: V\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-604)</span>


Create a generator for `Map` from a generator of key-value tuples
with insertion attempts in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

The generated maps can have fewer entries than the lower bound
when the source generator `gen` produces duplicate keys.
Duplicate keys (based on structural equality) overwrite earlier entries.


```pony
fun box map_of[K: (Hashable #read & Equatable[K] #read), V: V](
  gen: Generator[(K , V)] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[Map[K, V]] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[(K , V)\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[Map](collections-Map.md)\[K, V\]\] box

---

### map_is_of\[K: K, V: V\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-645)</span>


Create a generator for `MapIs` from a generator of key-value tuples
with insertion attempts in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

The generated maps can have fewer entries than the lower bound
when the source generator `gen` produces duplicate keys.
Duplicate keys (based on identity) overwrite earlier entries.


```pony
fun box map_is_of[K: K, V: V](
  gen: Generator[(K , V)] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[MapIs[K, V]] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[(K , V)\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[MapIs](collections-MapIs.md)\[K, V\]\] box

---

### one_of\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-686)</span>


Generate a random value from the given ReadSeq.
This generator will generate nothing if the given xs is empty.

Generators created with this method do not support shrinking.
If `do_shrink` is set to `true`, it will return the same value
for each shrink round. Otherwise it will return nothing.


```pony
fun box one_of[T: T](
  xs: ReadSeq[T] box,
  do_shrink: Bool val = false)
: Generator[box->T] box
```
#### Parameters

*   xs: [ReadSeq](builtin-ReadSeq.md)\[T\] box
*   do_shrink: [Bool](builtin-Bool.md) val = false

#### Returns

* [Generator](pony_check-Generator.md)\[box->T\] box

---

### one_of_safe\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-708)</span>


Version of `one_of` that will error if `xs` is empty.


```pony
fun box one_of_safe[T: T](
  xs: ReadSeq[T] box,
  do_shrink: Bool val = false)
: Generator[box->T] box ?
```
#### Parameters

*   xs: [ReadSeq](builtin-ReadSeq.md)\[T\] box
*   do_shrink: [Bool](builtin-Bool.md) val = false

#### Returns

* [Generator](pony_check-Generator.md)\[box->T\] box ?

---

### frequency\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-719)</span>


Choose a value of one of the given Generators,
while controlling the distribution with the associated weights.

The weights are of type `USize` and control how likely a value is chosen.
The likelihood of a value `v` to be chosen
is `weight_v` / `weights_sum`.
If all `weighted_generators` have equal size the distribution
will be uniform.

Example of a generator to output odd `U8` values
twice as likely as even ones:

```pony
Generators.frequency[U8]([
  (1, Generators.u8().filter({(u) => (u, (u % 2) == 0 }))
  (2, Generators.u8().filter({(u) => (u, (u % 2) != 0 }))
])
```


```pony
fun box frequency[T: T](
  weighted_generators: ReadSeq[WeightedGenerator[T]] box)
: Generator[T] box
```
#### Parameters

*   weighted_generators: [ReadSeq](builtin-ReadSeq.md)\[[WeightedGenerator](pony_check-WeightedGenerator.md)\[T\]\] box

#### Returns

* [Generator](pony_check-Generator.md)\[T\] box

---

### frequency_safe\[T: T\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-784)</span>


Version of `frequency` that errors if the given `weighted_generators` is
empty.


```pony
fun box frequency_safe[T: T](
  weighted_generators: ReadSeq[WeightedGenerator[T]] box)
: Generator[T] box ?
```
#### Parameters

*   weighted_generators: [ReadSeq](builtin-ReadSeq.md)\[[WeightedGenerator](pony_check-WeightedGenerator.md)\[T\]\] box

#### Returns

* [Generator](pony_check-Generator.md)\[T\] box ?

---

### zip2\[T1: T1, T2: T2\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-797)</span>


Zip two generators into a generator of a 2-tuple
containing the values generated by both generators.


```pony
fun box zip2[T1: T1, T2: T2](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box)
: Generator[(T1 , T2)] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box

#### Returns

* [Generator](pony_check-Generator.md)\[(T1 , T2)\] box

---

### zip3\[T1: T1, T2: T2, T3: T3\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-824)</span>


Zip three generators into a generator of a 3-tuple
containing the values generated by those three generators.


```pony
fun box zip3[T1: T1, T2: T2, T3: T3](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box,
  gen3: Generator[T3] box)
: Generator[(T1 , T2 , T3)] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box
*   gen3: [Generator](pony_check-Generator.md)\[T3\] box

#### Returns

* [Generator](pony_check-Generator.md)\[(T1 , T2 , T3)\] box

---

### zip4\[T1: T1, T2: T2, T3: T3, T4: T4\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-858)</span>


Zip four generators into a generator of a 4-tuple
containing the values generated by those four generators.


```pony
fun box zip4[T1: T1, T2: T2, T3: T3, T4: T4](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box,
  gen3: Generator[T3] box,
  gen4: Generator[T4] box)
: Generator[(T1 , T2 , T3 , T4)] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box
*   gen3: [Generator](pony_check-Generator.md)\[T3\] box
*   gen4: [Generator](pony_check-Generator.md)\[T4\] box

#### Returns

* [Generator](pony_check-Generator.md)\[(T1 , T2 , T3 , T4)\] box

---

### map2\[T1: T1, T2: T2, T3: T3\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-897)</span>


Convenience combinator for mapping 2 generators into 1.


```pony
fun box map2[T1: T1, T2: T2, T3: T3](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box,
  fn: {(T1, T2): T3^}[T1, T2, T3] ref)
: Generator[T3] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box
*   fn: {(T1, T2): T3^}[T1, T2, T3] ref

#### Returns

* [Generator](pony_check-Generator.md)\[T3\] box

---

### map3\[T1: T1, T2: T2, T3: T3, T4: T4\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-912)</span>


Convenience combinator for mapping 3 generators into 1.


```pony
fun box map3[T1: T1, T2: T2, T3: T3, T4: T4](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box,
  gen3: Generator[T3] box,
  fn: {(T1, T2, T3): T4^}[T1, T2, T3, T4] ref)
: Generator[T4] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box
*   gen3: [Generator](pony_check-Generator.md)\[T3\] box
*   fn: {(T1, T2, T3): T4^}[T1, T2, T3, T4] ref

#### Returns

* [Generator](pony_check-Generator.md)\[T4\] box

---

### map4\[T1: T1, T2: T2, T3: T3, T4: T4, T5: T5\]
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-928)</span>


Convenience combinator for mapping 4 generators into 1.


```pony
fun box map4[T1: T1, T2: T2, T3: T3, T4: T4, T5: T5](
  gen1: Generator[T1] box,
  gen2: Generator[T2] box,
  gen3: Generator[T3] box,
  gen4: Generator[T4] box,
  fn: {(T1, T2, T3, T4): T5^}[T1, T2, T3, T4, T5] ref)
: Generator[T5] box
```
#### Parameters

*   gen1: [Generator](pony_check-Generator.md)\[T1\] box
*   gen2: [Generator](pony_check-Generator.md)\[T2\] box
*   gen3: [Generator](pony_check-Generator.md)\[T3\] box
*   gen4: [Generator](pony_check-Generator.md)\[T4\] box
*   fn: {(T1, T2, T3, T4): T5^}[T1, T2, T3, T4, T5] ref

#### Returns

* [Generator](pony_check-Generator.md)\[T5\] box

---

### bool
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-945)</span>


Create a generator of bool values.


```pony
fun box bool()
: Generator[Bool val] box
```

#### Returns

* [Generator](pony_check-Generator.md)\[[Bool](builtin-Bool.md) val\] box

---

### u8
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1018)</span>


Create a generator for U8 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box u8(
  from: U8 val = U8.min_value(),
  to: U8 val = U8.max_value())
: Generator[U8 val] box
```
#### Parameters

*   from: [U8](builtin-U8.md) val = U8.min_value()
*   to: [U8](builtin-U8.md) val = U8.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[U8](builtin-U8.md) val\] box

---

### u16
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1040)</span>


Create a generator for U16 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box u16(
  from: U16 val = U16.min_value(),
  to: U16 val = U16.max_value())
: Generator[U16 val] box
```
#### Parameters

*   from: [U16](builtin-U16.md) val = U16.min_value()
*   to: [U16](builtin-U16.md) val = U16.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[U16](builtin-U16.md) val\] box

---

### u32
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1062)</span>


Create a generator for U32 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box u32(
  from: U32 val = U32.min_value(),
  to: U32 val = U32.max_value())
: Generator[U32 val] box
```
#### Parameters

*   from: [U32](builtin-U32.md) val = U32.min_value()
*   to: [U32](builtin-U32.md) val = U32.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[U32](builtin-U32.md) val\] box

---

### u64
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1084)</span>


Create a generator for U64 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box u64(
  from: U64 val = U64.min_value(),
  to: U64 val = U64.max_value())
: Generator[U64 val] box
```
#### Parameters

*   from: [U64](builtin-U64.md) val = U64.min_value()
*   to: [U64](builtin-U64.md) val = U64.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[U64](builtin-U64.md) val\] box

---

### u128
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1106)</span>


Create a generator for U128 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box u128(
  from: U128 val = U128.min_value(),
  to: U128 val = U128.max_value())
: Generator[U128 val] box
```
#### Parameters

*   from: [U128](builtin-U128.md) val = U128.min_value()
*   to: [U128](builtin-U128.md) val = U128.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[U128](builtin-U128.md) val\] box

---

### usize
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1128)</span>


Create a generator for USize values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box usize(
  from: USize val = USize.min_value(),
  to: USize val = USize.max_value())
: Generator[USize val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = USize.min_value()
*   to: [USize](builtin-USize.md) val = USize.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[USize](builtin-USize.md) val\] box

---

### ulong
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1150)</span>


Create a generator for ULong values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box ulong(
  from: ULong val = ULong.min_value(),
  to: ULong val = ULong.max_value())
: Generator[ULong val] box
```
#### Parameters

*   from: [ULong](builtin-ULong.md) val = ULong.min_value()
*   to: [ULong](builtin-ULong.md) val = ULong.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[ULong](builtin-ULong.md) val\] box

---

### i8
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1172)</span>


Create a generator for I8 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box i8(
  from: I8 val = I8.min_value(),
  to: I8 val = I8.max_value())
: Generator[I8 val] box
```
#### Parameters

*   from: [I8](builtin-I8.md) val = I8.min_value()
*   to: [I8](builtin-I8.md) val = I8.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[I8](builtin-I8.md) val\] box

---

### i16
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1194)</span>


Create a generator for I16 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box i16(
  from: I16 val = I16.min_value(),
  to: I16 val = I16.max_value())
: Generator[I16 val] box
```
#### Parameters

*   from: [I16](builtin-I16.md) val = I16.min_value()
*   to: [I16](builtin-I16.md) val = I16.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[I16](builtin-I16.md) val\] box

---

### i32
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1216)</span>


Create a generator for I32 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box i32(
  from: I32 val = I32.min_value(),
  to: I32 val = I32.max_value())
: Generator[I32 val] box
```
#### Parameters

*   from: [I32](builtin-I32.md) val = I32.min_value()
*   to: [I32](builtin-I32.md) val = I32.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[I32](builtin-I32.md) val\] box

---

### i64
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1238)</span>


Create a generator for I64 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box i64(
  from: I64 val = I64.min_value(),
  to: I64 val = I64.max_value())
: Generator[I64 val] box
```
#### Parameters

*   from: [I64](builtin-I64.md) val = I64.min_value()
*   to: [I64](builtin-I64.md) val = I64.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[I64](builtin-I64.md) val\] box

---

### i128
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1260)</span>


Create a generator for I128 values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box i128(
  from: I128 val = I128.min_value(),
  to: I128 val = I128.max_value())
: Generator[I128 val] box
```
#### Parameters

*   from: [I128](builtin-I128.md) val = I128.min_value()
*   to: [I128](builtin-I128.md) val = I128.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[I128](builtin-I128.md) val\] box

---

### ilong
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1282)</span>


Create a generator for ILong values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box ilong(
  from: ILong val = ILong.min_value(),
  to: ILong val = ILong.max_value())
: Generator[ILong val] box
```
#### Parameters

*   from: [ILong](builtin-ILong.md) val = ILong.min_value()
*   to: [ILong](builtin-ILong.md) val = ILong.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[ILong](builtin-ILong.md) val\] box

---

### isize
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1304)</span>


Create a generator for ISize values
in the range `from` to `to`.
The order of `from` and `to` does not matter.


```pony
fun box isize(
  from: ISize val = ISize.min_value(),
  to: ISize val = ISize.max_value())
: Generator[ISize val] box
```
#### Parameters

*   from: [ISize](builtin-ISize.md) val = ISize.min_value()
*   to: [ISize](builtin-ISize.md) val = ISize.max_value()

#### Returns

* [Generator](pony_check-Generator.md)\[[ISize](builtin-ISize.md) val\] box

---

### byte_string
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1326)</span>


Create a generator for strings
generated from the bytes returned by the generator `gen`,
with length in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box byte_string(
  gen: Generator[U8 val] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[[U8](builtin-U8.md) val\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### ascii
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1377)</span>


Create a generator for strings within the given `range`,
with length in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box ascii(
  from: USize val = 0,
  to: USize val = 100,
  range: ASCIIRange = ASCIIAll)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100
*   range: [ASCIIRange](pony_check-ASCIIRange.md) = ASCIIAll

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### ascii_printable
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1403)</span>


Create a generator for strings of printable ASCII characters,
with length in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box ascii_printable(
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### ascii_numeric
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1417)</span>


Create a generator for strings of numeric ASCII characters,
with length in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box ascii_numeric(
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### ascii_letters
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1431)</span>


Create a generator for strings of ASCII letters,
with length in the range `from` to `to`.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.


```pony
fun box ascii_letters(
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### utf32_codepoint_string
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1445)</span>


Create a generator for strings
from a generator of unicode codepoints,
with length in the range `from` to `to` codepoints.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

Note that the byte length of the generated string can be up to 4 times
the size in code points.


```pony
fun box utf32_codepoint_string(
  gen: Generator[U32 val] box,
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   gen: [Generator](pony_check-Generator.md)\[[U32](builtin-U32.md) val\] box
*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### unicode
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1516)</span>


Create a generator for unicode strings,
with length in the range `from` to `to` codepoints.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

Note that the byte length of the generated string can be up to 4 times
the size in code points.


```pony
fun box unicode(
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### unicode_bmp
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-1545)</span>


Create a generator for unicode strings
from the basic multilingual plane only,
with length in the range `from` to `to` codepoints.
The order of `from` and `to` does not matter.

Defaults are 0 and 100.

Note that the byte length of the generated string can be up to 4 times
the size in code points.


```pony
fun box unicode_bmp(
  from: USize val = 0,
  to: USize val = 100)
: Generator[String val] box
```
#### Parameters

*   from: [USize](builtin-USize.md) val = 0
*   to: [USize](builtin-USize.md) val = 100

#### Returns

* [Generator](pony_check-Generator.md)\[[String](builtin-String.md) val\] box

---

### eq
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-323)</span>


```pony
fun box eq(
  that: Generators val)
: Bool val
```
#### Parameters

*   that: [Generators](pony_check-Generators.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

### ne
<span class="source-link">[[Source]](src/pony_check/gen_obj.md#L-0-323)</span>


```pony
fun box ne(
  that: Generators val)
: Bool val
```
#### Parameters

*   that: [Generators](pony_check-Generators.md) val

#### Returns

* [Bool](builtin-Bool.md) val

---

