import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/definition";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/continueOrRetry";
/**
 * Filters the value produced by this effect, retrying the transaction while
 * the predicate returns true for the value.
 *
 * @tsplus fluent ets/STM retryWhile
 */

export function retryWhile_(self, f) {
  return tsplus_module_2.continueOrRetry_(self, a => f(a) ? tsplus_module_1.none : tsplus_module_1.some(a));
}
/**
 * Filters the value produced by this effect, retrying the transaction while
 * the predicate returns true for the value.
 *
 * @ets_data_first retryWhile_
 */

export const retryWhile = f => self => retryWhile_(self, f);
//# sourceMappingURL=retryWhile.mjs.map