import * as tsplus_module_1 from "@tsplus/stdlib/data/Maybe/getOrElse";
import * as tsplus_module_2 from "@effect/core/stm/TRef/operations/getAndUpdate";
/**
 * Updates some values of the variable but leaves others alone, returning the
 * old value.
 *
 * @tsplus fluent ets/TRef getAndUpdateSome
 */

export function getAndUpdateSome_(self, pf) {
  return tsplus_module_2.getAndUpdate_(self, a => tsplus_module_1.getOrElse_(pf(a), () => a));
}
/**
 * Updates some values of the variable but leaves others alone, returning the
 * old value.
 *
 * @tsplus static ets/TRef/Aspects getAndUpdateSome
 */

export const getAndUpdateSome = pf => self => getAndUpdateSome_(self, pf);
//# sourceMappingURL=getAndUpdateSome.mjs.map