Hedgehog


Tree Module

Namespace: Hedgehog

Assembly: Hedgehog.dll

Functions and values

Function or value Description

addChild child parent

Full Usage: addChild child parent

Parameters:
Returns: Tree<'a>

child : Tree<'a>
parent : Tree<'a>
Returns: Tree<'a>

addChildValue a tree

Full Usage: addChildValue a tree

Parameters:
    a : 'a
    tree : Tree<'a>

Returns: Tree<'a>

a : 'a
tree : Tree<'a>
Returns: Tree<'a>

bind k arg2

Full Usage: bind k arg2

Parameters:
Returns: Tree<'b>

k : 'a -> Tree<'b>
arg1 : Tree<'a>
Returns: Tree<'b>

cata f arg2

Full Usage: cata f arg2

Parameters:
    f : 'a -> seq<'b> -> 'b
    arg1 : Tree<'a>

Returns: 'b

f : 'a -> seq<'b> -> 'b
arg1 : Tree<'a>
Returns: 'b

depth tree

Full Usage: depth tree

Parameters:
Returns: int

tree : Tree<'a>
Returns: int

duplicate arg1

Full Usage: duplicate arg1

Parameters:
Returns: Tree<Tree<'a>>

Turns a tree, in to a tree of trees. Useful for testing Hedgehog itself as it allows you to observe the shrinks for a value inside a property, while still allowing the property to shrink to a minimal counterexample.

arg0 : Tree<'a>
Returns: Tree<Tree<'a>>

expand f arg2

Full Usage: expand f arg2

Parameters:
    f : 'a -> seq<'a>
    arg1 : Tree<'a>

Returns: Tree<'a>

Apply an additional unfolding function to an existing tree. The root outcome remains intact, only the shrinks are affected, this applies recursively, so shrinks can only ever be added using this function. If you want to replace the shrinks altogether, try: Tree.unfold f (outcome oldTree)

f : 'a -> seq<'a>
arg1 : Tree<'a>
Returns: Tree<'a>

filter f arg2

Full Usage: filter f arg2

Parameters:
    f : 'a -> bool
    arg1 : Tree<'a>

Returns: Tree<'a>

Recursively discard any shrinks whose outcome does not pass the predicate. Note that the root outcome can never be discarded.

f : 'a -> bool
arg1 : Tree<'a>
Returns: Tree<'a>

filterForest f xs

Full Usage: filterForest f xs

Parameters:
    f : 'a -> bool
    xs : seq<Tree<'a>>

Returns: seq<Tree<'a>>

Recursively discard any trees whose outcome does not pass the predicate.

f : 'a -> bool
xs : seq<Tree<'a>>
Returns: seq<Tree<'a>>

fold f g arg3

Full Usage: fold f g arg3

Parameters:
    f : 'a -> 'x -> 'b
    g : seq<'b> -> 'x
    arg2 : Tree<'a>

Returns: 'b

Fold over a tree.

f : 'a -> 'x -> 'b
g : seq<'b> -> 'x
arg2 : Tree<'a>
Returns: 'b

foldForest f g xs

Full Usage: foldForest f g xs

Parameters:
    f : 'a -> 'x -> 'b
    g : seq<'b> -> 'x
    xs : seq<Tree<'a>>

Returns: 'x

Fold over a list of trees.

f : 'a -> 'x -> 'b
g : seq<'b> -> 'x
xs : seq<Tree<'a>>
Returns: 'x

join xss

Full Usage: join xss

Parameters:
Returns: Tree<'a>

xss : Tree<Tree<'a>>
Returns: Tree<'a>

map f arg2

Full Usage: map f arg2

Parameters:
    f : 'a -> 'b
    arg1 : Tree<'a>

Returns: Tree<'b>

Map over a tree.

f : 'a -> 'b
arg1 : Tree<'a>
Returns: Tree<'b>

mapWithSubtrees f tree

Full Usage: mapWithSubtrees f tree

Parameters:
    f : 'a -> seq<Tree<'b>> -> 'b
    tree : Tree<'a>

Returns: Tree<'b>

f : 'a -> seq<Tree<'b>> -> 'b
tree : Tree<'a>
Returns: Tree<'b>

outcome arg1

Full Usage: outcome arg1

Parameters:
Returns: 'a

The generated outcome.

arg0 : Tree<'a>
Returns: 'a

render t

Full Usage: render t

Parameters:
Returns: string

t : Tree<string>
Returns: string

renderList arg1

Full Usage: renderList arg1

Parameters:
    arg0 : Tree<string>

Returns: List<string>

arg0 : Tree<string>
Returns: List<string>

shrinks arg1

Full Usage: shrinks arg1

Parameters:
Returns: seq<Tree<'a>>

All the possible shrinks of this outcome. This should be ordered smallest to largest as if property still fails with the first shrink in the list then we will commit to that path and none of the others will be tried (i.e. there is no backtracking).

arg0 : Tree<'a>
Returns: seq<Tree<'a>>

singleton x

Full Usage: singleton x

Parameters:
    x : 'a

Returns: Tree<'a>

Create a tree with a single outcome and no shrinks.

x : 'a
Returns: Tree<'a>

toSeq tree

Full Usage: toSeq tree

Parameters:
Returns: seq<'a>

tree : Tree<'a>
Returns: seq<'a>

unfold f g x

Full Usage: unfold f g x

Parameters:
    f : 'b -> 'a
    g : 'b -> seq<'b>
    x : 'b

Returns: Tree<'a>

Build a tree from an unfolding function and a seed value.

f : 'b -> 'a
g : 'b -> seq<'b>
x : 'b
Returns: Tree<'a>

unfoldForest f g x

Full Usage: unfoldForest f g x

Parameters:
    f : 'b -> 'a
    g : 'b -> seq<'b>
    x : 'b

Returns: seq<Tree<'a>>

Build a list of trees from an unfolding function and a seed value.

f : 'b -> 'a
g : 'b -> seq<'b>
x : 'b
Returns: seq<Tree<'a>>