# Module proper_gen

- Description
- Data Types
- Function Index
- Function Details

Generator subsystem and generators for basic types.

Copyright © 2010-2022 Manolis Papadakis, Eirini Arvaniti and Kostis Sagonas

Authors: Manolis Papadakis.

## Description

Generator subsystem and generators for basic types.

You can use these functions to try out the random instance generation and shrinking subsystems.

CAUTION: These functions should never be used inside properties. They are meant for demonstration purposes only.

## Data Types

### instance()

    instance() = term()

### seed()

    seed() =
        {non_neg_integer(), non_neg_integer(), non_neg_integer()}

### size()

    size() = non_neg_integer()

## Function Index

pick/1 | Equivalent to `pick(Type, 10)`.
pick/2 | Equivalent to `pick(Type, Size, os:timestamp())`.
pick/3 | Generates a random instance of `Type`, of size `Size` with seed `Seed`.
sample/1 | Equivalent to `sample(Type, 10, 20)`.
sample/3 | Generates and prints one random instance of `Type` for each size from `StartSize` up to `EndSize`.
sampleshrink/1 | Equivalent to `sampleshrink(Type, 10)`.
sampleshrink/2 | Generates a random instance of `Type`, of size `Size`, then shrinks it as far as it goes.

## Function Details

### pick/1

    pick(Type :: proper_types:raw_type()) -> {ok, instance()} | error

Equivalent to `pick(Type, 10)`.

### pick/2

    pick(Type :: proper_types:raw_type(), Size :: size()) ->
            {ok, instance()} | error

Equivalent to `pick(Type, Size, os:timestamp())`.

### pick/3

    pick(Type :: proper_types:raw_type(),
         Size :: size(),
         Seed :: seed()) ->
            {ok, instance()} | error

Generates a random instance of `Type`, of size `Size` with seed `Seed`.

### sample/1

    sample(Type :: proper_types:raw_type()) -> ok

Equivalent to `sample(Type, 10, 20)`.

### sample/3

    sample(Type :: proper_types:raw_type(),
           StartSize :: size(),
           EndSize :: size()) ->
              ok

Generates and prints one random instance of `Type` for each size from `StartSize` up to `EndSize`.

### sampleshrink/1

    sampleshrink(Type :: proper_types:raw_type()) -> ok

Equivalent to `sampleshrink(Type, 10)`.

### sampleshrink/2

    sampleshrink(Type :: proper_types:raw_type(), Size :: size()) ->
                    ok

Generates a random instance of `Type`, of size `Size`, then shrinks it as far as it goes. The value produced on each step of the shrinking process is printed on the screen.

Generated by EDoc