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/io/FiberRef/operations/modify";
/**
 * Atomically modifies the `FiberRef` with the specified partial function,
 * which computes a return value for the modification if the function is
 * defined in the current value otherwise it returns a default value. This
 * is a more powerful version of `updateSome`.
 *
 * @tsplus fluent ets/FiberRef modifySome
 */

export function modifySome_(self, def, f, __tsplusTrace) {
  return tsplus_module_3.modify_(self, v => tsplus_module_2.getOrElse_(f(v), () => tsplus_module_1.make(def, v)), __tsplusTrace);
}
/**
 * Atomically modifies the `FiberRef` with the specified partial function,
 * which computes a return value for the modification if the function is
 * defined in the current value otherwise it returns a default value. This
 * is a more powerful version of `updateSome`.
 *
 * @tsplus static ets/FiberRef/Aspects modifySome
 */

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