import * as tsplus_module_1 from "@effect/core/io/Scope/operations/use";
import * as tsplus_module_2 from "@effect/core/io/Scope/operations/make";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/flatMap";
/**
 * Scopes all resources uses in this workflow to the lifetime of the workflow,
 * ensuring that their finalizers are run as soon as this workflow completes
 * execution, whether by success, failure, or interruption.
 *
 * @tsplus static ets/Effect/Ops scoped
 * @tsplus fluent ets/Effect scoped
 */

export function scoped(effect, __tsplusTrace) {
  return tsplus_module_3.flatMap_(tsplus_module_2.make, scope => tsplus_module_1.use_(scope, effect), __tsplusTrace);
}
//# sourceMappingURL=scoped.mjs.map