// ets_tracing: off
import * as CK from "../../../../Collections/Immutable/Chunk";
import * as Tp from "../../../../Collections/Immutable/Tuple";
import * as T from "../../../../Effect";
import * as O from "../../../../Option";
import * as UnfoldChunkEffect from "./unfoldChunkEffect";
/**
 * Creates a stream by effectfully peeling off the "layers" of a value of type `S`
 */

export function unfoldEffect(s, f) {
  return UnfoldChunkEffect.unfoldChunkEffect(s, _ => T.map_(f(_), O.map(({
    tuple: [a, s]
  }) => Tp.tuple(CK.single(a), s))));
}
//# sourceMappingURL=unfoldEffect.js.map