schema.spec.collection

A collection spec represents a collection of elements,
each of which is itself schematized.

all-elements

(all-elements schema)

collection-spec

(collection-spec pre konstructor elements on-error)
A collection represents a collection of elements, each of which is itself
schematized.  At the top level, the collection has a precondition
(presumably on the overall type), a constructor for the collection from a
sequence of items, an element spec, and a function that constructs a
descriptive error on failure.

The element spec is a nested list structure, in which the leaf elements each
provide an element schema, parser (allowing for efficient processing of structured
collections), and optional error wrapper.  Each item in the list can be a leaf
element or an `optional` nested element spec (see below).  In addition, the final
element can be a `remaining` schema (see below).

Note that the `optional` carries no semantics with respect to validation;
the user must ensure that the parser enforces the desired semantics, which
should match the structure of the spec for proper generation.

one-element

(one-element required? schema parser)

optional

(optional & ss)
If any more elements are present, they must match the elements in 'ss'

optional-tail

(optional-tail schema parser more)

remaining

(remaining s)
All remaining elements must match schema s

subschemas

(subschemas elt)