import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_3 from "@effect/core/stm/TRef/operations/modify";
/**
 * Updates the value of the variable, returning a function of the specified
 * value.
 *
 * @tsplus fluent ets/TRef modifySome
 */

export function modifySome_(self, def, pf) {
  return tsplus_module_3.modify_(self, a => tsplus_module_2.getOrElse_(pf(a), () => tsplus_module_1.make(def, a)));
}
/**
 * Updates the value of the variable, returning a function of the specified
 * value.
 *
 * @tsplus static ets/TRef/Aspects modifySome
 */

export const modifySome = (def, pf) => self => modifySome_(self, def, pf);
//# sourceMappingURL=modifySome.mjs.map