/** * @tsplus static effect/core/testing/Sample.Ops unfold */ export function unfold( s: S, f: (s: S) => readonly [A, Stream] ): Sample { const [value, shrink] = f(s) return Sample(value, shrink.map(s => Maybe.some(Sample.unfold(s, f))).intersperse(Maybe.none)) }