import * as tsplus_module_1 from "@tsplus/stdlib/data/Tuple/make";
import * as tsplus_module_2 from "@effect/core/io/FiberRef/operations/modify";
/**
 * Atomically sets the value associated with the current fiber and returns
 * the old value.
 *
 * @tsplus fluent ets/FiberRef getAndSet
 */

export function getAndSet_(self, value, __tsplusTrace) {
  return tsplus_module_2.modify_(self, v => tsplus_module_1.make(v, value), __tsplusTrace);
}
/**
 * Atomically sets the value associated with the current fiber and returns
 * the old value.
 *
 * @tsplus static ets/FiberRef/Aspects getAndSet
 */

export const getAndSet = (value, __tsplusTrace) => self => getAndSet_(self, value, __tsplusTrace);
//# sourceMappingURL=getAndSet.mjs.map