const fileName_1 = "(@effect/core) _src/io/Effect/operations/loopDiscard.ts";
import * as tsplus_module_1 from "@effect/core/io/Effect/operations/zipRight";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/unit";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/suspendSucceed";
export const loopDiscard = loopDiscard_1;
/**
 * Loops with the specified effectual function purely for its effects. The
 * moral equivalent of:
 *
 * ```typescript
 * var s = initial
 *
 * while (cont(s)) {
 *   body(s)
 *   s = inc(s)
 * }
 * ```
 *
 * @tsplus static ets/Effect/Ops loopDiscard
 */

function loopDiscard_1(initial, cont, inc) {
  return (body, __tsplusTrace) => {
    return tsplus_module_3.suspendSucceed(() => {
      const initial0 = initial();
      return cont(initial0) ? tsplus_module_1.zipRight_(body(initial0), () => loopDiscard_1(() => inc(initial0), cont, inc)(body, fileName_1 + ":28:65"), fileName_1 + ":28:27") : tsplus_module_2.unit;
    }, fileName_1 + ":25:33");
  };
}
//# sourceMappingURL=loopDiscard.mjs.map