Module IO.Sampling

type stable
val draw : state -> float

Return one finite draw greater than or equal to zero and less than one. The core validates the result and contains ordinary exceptions. Runtime composition owns concrete randomness.

val create_stable : state -> stable

Allocate a fresh unresolved one-shot draw without invoking the random source or performing concrete I/O.

val draw_stable : state -> stable -> float

Resolve that draw at most once. Concurrent callers receive the same result without invoking the source more than once. A source exception is replayed with its original backtrace. Core contains and diagnoses ordinary source failures while preserving runtime control exceptions.