import * as tsplus_module_1 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_3 from "@tsplus/stdlib/collections/Chunk/definition";
import * as tsplus_module_4 from "@tsplus/stdlib/collections/Chunk/reduceRight";
import * as tsplus_module_5 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * Folds an `Collection<A>` using an effectual function f, working sequentially from left to right.
 *
 * @tsplus static ets/Effect/Ops reduceRight
 */

export function reduceRight_(as, z, f, __tsplusTrace) {
  return tsplus_module_5.suspendSucceed(() => tsplus_module_4.reduceRight_(tsplus_module_3.from(as()), tsplus_module_1.succeed(z, __tsplusTrace), (el, acc) => tsplus_module_2.flatMap_(acc, a => f(el, a), __tsplusTrace)), __tsplusTrace);
}
//# sourceMappingURL=reduceRight.mjs.map