tree: Lazy rose trees

Description Usage Arguments Details

View source: R/tree.R

Description

A rose tree is a type of multibranch tree. This is hedgehog's internal implementation of a lazy rose tree.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
tree(root, children_ = list())

tree.map(f, x)

tree.bind(f, x)

tree.liftA2(f, x, y)

tree.expand(shrink, x)

tree.unfold(shrink, a)

tree.unfoldForest(shrink, a)

tree.sequence(trees)

Arguments

root

the root of the rose tree

children_

a list of children for the tree.

f

a function for mapping, binding, or applying

x

a tree to map or bind over

y

a tree to map or bind over

shrink

a shrinking function

a

a value to unfold from

trees

a tree, or list or structure potentially containing trees to turn into a tree of said structure.

Details

In general, one should not be required to use any of the functions from this module as the combinators in the gen module should be expressive enough (if they're not raise an issue).


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