gen.recursive: Build recursive structures in a way that guarantees...

Description Usage Arguments Examples

View source: R/gen.R

Description

This will choose between the recursive and non-recursive terms, while shrinking the size of the recursive calls.

Usage

1
gen.recursive(tails, heads)

Arguments

tails

a list of generators which should not contain recursive terms.

heads

a list of generator which may contain recursive terms.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Generating a tree with integer leaves
treeGen <-
  gen.recursive(
    # The non-recursive cases
    list(
      gen.int(100)
    )
  , # The recursive cases
    list(
      gen.list( treeGen )
    )
  )

hedgehog documentation built on May 2, 2019, 11:27 a.m.