import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@effect/core/io/FiberRef/operations/modify";
/**
 * Atomically modifies the `FiberRef` with the specified function and
 * returns the result.
 *
 * @tsplus fluent ets/FiberRef updateAndGet
 */

export function updateAndGet_(self, f, __tsplusTrace) {
  return tsplus_module_2.modify_(self, v => {
    const result = f(v);
    return tsplus_module_1.make(result, result);
  }, __tsplusTrace);
}
/**
 * Atomically modifies the `FiberRef` with the specified function and
 * returns the result.
 *
 * @tsplus static ets/FiberRef/Aspects updateAndGet
 */

export const updateAndGet = (f, __tsplusTrace) => self => updateAndGet_(self, f, __tsplusTrace);
//# sourceMappingURL=updateAndGet.mjs.map