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

export function reduceM_(self, s, f) {
  ;

  if (self._typeId === SingletonTypeId) {
    return f(s, self.a);
  }

  return reduce_(self, core.succeed(s, fileName_1 + ":19:36"), (s, a) => core.chain_(s, s1 => f(s1, a), fileName_1 + ":20:16"));
}
/**
 * Folds over the elements in this chunk from the left.
 *
 * @ets_data_first reduceM_
 */

export function reduceM(s, f) {
  return self => reduceM_(self, s, f);
}
//# sourceMappingURL=reduceM.js.map