Hyperlinkv0.8.0-beta.28

Schema

Schema.toArbitraryLazyfunctioneffect/Schema.ts:13045
<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]>

Derives a LazyArbitrary from a schema. The result is memoized so repeated calls with the same schema are cheap.

Details

Prefer toArbitrary when you need the arbitrary directly, or when you want derivation diagnostics via { report: true }. Unsupported schema nodes, impossible constraints, invalid candidates, and recursive schemas without a finite terminal path fail immediately.

export function toArbitraryLazy<S extends Constraint>(schema: S): LazyArbitrary<S["Type"]> {
  const lawc = InternalArbitrary.memoized(schema.ast)
  return (fc) => lawc(fc, {})
}
Referenced by 1 symbols