const fileName_1 = "(@effect/core) _src/io/Scope/operations/extend.ts";
import * as tsplus_module_1 from "@effect/core/io/Scope/definition";
import * as tsplus_module_2 from "@tsplus/stdlib/service/Env";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/provideSomeEnvironment";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/suspendSucceed";
/**
 * Extends the scope of an `Effect` workflow that needs a scope into this
 * scope by providing it to the workflow but not closing the scope when the
 * workflow completes execution. This allows extending a scoped value into a
 * larger scope.
 *
 * @tsplus fluent ets/Scope extend
 * @tsplus fluent ets/Scope/Closeable extend
 */

export function extend_(self, effect) {
  return tsplus_module_4.suspendSucceed(() => tsplus_module_3.provideSomeEnvironment_(effect(), env => env.merge(tsplus_module_2.Env(tsplus_module_1.Scope.Tag, self)), fileName_1 + ":15:36"), fileName_1 + ":14:31");
}
/**
 * Extends the scope of an `Effect` workflow that needs a scope into this
 * scope by providing it to the workflow but not closing the scope when the
 * workflow completes execution. This allows extending a scoped value into a
 * larger scope.
 *
 * @tsplus static ets/Scope/Aspects extend
 */

export const extend = effect => self => extend_(self, effect);
//# sourceMappingURL=extend.mjs.map