import * as tracing_1 from "../../../../Tracing"
import * as tracing_2 from "../../../../Tracing"
const fileName_1 =
  "(@effect-ts/system): _src/Collections/Immutable/Chunk/api/reduceRightM.ts"
import * as core from "../../../../Effect/core"
import { concrete, SingletonTypeId } from "../definition"
import { reduceRight_ } from "./reduceRight"
/**
 * Folds over the elements in this chunk from the right.
 */

export function reduceRightM_(self, s, f) {
  if (self._typeId === SingletonTypeId) {
    return f(self.a, s)
  }

  return reduceRight_(self, core.succeed(s, fileName_1 + ":19:41"), (a, s) =>
    core.chain_(s, (s1) => f(a, s1), fileName_1 + ":20:16")
  )
}
/**
 * Folds over the elements in this chunk from the right.
 *
 * @dataFirst reduceRightM_
 */

export function reduceRightM(s, f) {
  return (self) => reduceRightM_(self, s, f)
}
//# sourceMappingURL=reduceRightM.js.map
