Optionaloptions: RecursiveOptionsGenerate recursively structured data, such as trees or JSON documents,
whose leaves come from base.
extend receives a generator of sub-values (each a leaf or a further
branch) and returns a generator combining some of them into one compound
value; it is called afresh for each branch generated. Values range from a
single leaf up to the limits of maxDepth (how deeply branches nest,
default 32) and maxLeaves (the most leaves in one value, default 100: an
attempt drawing more is discarded and drawn again, and the test case is
rejected when several attempts in a row overrun). The engine decides where
values branch, so recursive values are distributed the same way in every
Hegel frontend. Values shrink toward a single leaf.
A value prints as its leaves and branches do, through base and the
generators extend returns, so it is printable when they are.
Throws if maxDepth is negative or maxLeaves is less than 1. For
mutually recursive definitions, use deferred.
Optionaloptions: RecursiveOptions
Generate recursively structured data, such as trees or JSON documents, whose leaves come from
base.extendreceives a generator of sub-values (each a leaf or a further branch) and returns a generator combining some of them into one compound value; it is called afresh for each branch generated. Values range from a single leaf up to the limits ofmaxDepth(how deeply branches nest, default 32) andmaxLeaves(the most leaves in one value, default 100: an attempt drawing more is discarded and drawn again, and the test case is rejected when several attempts in a row overrun). The engine decides where values branch, so recursive values are distributed the same way in every Hegel frontend. Values shrink toward a single leaf.A value prints as its leaves and branches do, through
baseand the generatorsextendreturns, so it is printable when they are.Throws if
maxDepthis negative ormaxLeavesis less than 1. For mutually recursive definitions, use deferred.