const fileName_1 = "(@effect/core) _src/stream/Stream/operations/unfoldEffect.ts";
import * as tsplus_module_1 from "@tsplus/stdlib/collections/Chunk/single";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_3 from "@tsplus/stdlib/data/Maybe/map";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_5 from "@effect/core/stream/Stream/operations/unfoldChunkEffect";
/**
 * Creates a stream by effectfully peeling off the "layers" of a value of type
 * `S`.
 *
 * @tsplus static ets/Stream/Ops unfoldEffect
 */

export function unfoldEffect(s, f) {
  return tsplus_module_5.unfoldChunkEffect(s, s => tsplus_module_4.map_(f(s), option => tsplus_module_3.map_(option, ({
    tuple: [a, s]
  }) => tsplus_module_2.make(tsplus_module_1.single(a), s)), fileName_1 + ":13:20"));
}
//# sourceMappingURL=unfoldEffect.mjs.map