/** * Creates a stream by effectfully peeling off the "layers" of a value of type * `S`. * * @tsplus static effect/core/stream/Stream.Ops unfoldEffect */ export function unfoldEffect( s: S, f: (s: S) => Effect> ): Stream { return Stream.unfoldChunkEffect( s, (s) => f(s).map((option) => option.map(([a, s]) => [Chunk.single(a), s])) ) }