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 "@effect/core/io/Effect/operations/map";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/paginateChunkEffect";
/**
 * Like `unfoldEffect`, but allows the emission of values to end one step
 * further than the unfolding of the state. This is useful for embedding
 * paginated APIs, hence the name.
 *
 * @tsplus static ets/Stream/Ops paginateEffect
 */

export function paginateEffect(s, f, __tsplusTrace) {
  return tsplus_module_4.paginateChunkEffect(s, s => tsplus_module_3.map_(f(s), ({
    tuple: [a, s]
  }) => tsplus_module_2.make(tsplus_module_1.single(a), s), __tsplusTrace), __tsplusTrace);
}
//# sourceMappingURL=paginateEffect.mjs.map