Produces a contract that, when applied to a value, first tests the
value with predicate; if predicate returns true, the
then-contract is applied; otherwise, the
else-contract is applied. The resulting contract is a flat
contract if both then-contract and else-contract are
flat contracts.
For example, the following contract enforces that if a value is a
procedure, it is a thunk; otherwise it can be any (non-procedure)
value:
This contract recognizes Scheme truth values, i.e., any value, but with a more
informative name and description. Use it in negative positions for arguments
that accept arbitrary truth values that may not be booleans.
Wraps a sequence,
obligating it to produce as many values as there are elem/c contracts,
and obligating each value to satisfy the corresponding elem/c. The
result is not guaranteed to be the same kind of sequence as the original value;
for instance, a wrapped list is not guaranteed to satisfy list?.