import * as tsplus_module_1 from "@effect/core/io/FiberRef/operations/currentEnvironment";
import * as tsplus_module_2 from "@effect/core/io/FiberRef/operations/locally";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/succeed";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/flatMap";
/**
 * Provides the effect with its required environment, which eliminates its
 * dependency on `R`.
 *
 * @tsplus fluent ets/Effect provideEnvironment
 */

export function provideEnvironment_(self, environment, __tsplusTrace) {
  return tsplus_module_4.flatMap_(tsplus_module_3.succeed(environment, __tsplusTrace), env => tsplus_module_2.locally_(tsplus_module_1.currentEnvironment.value, env, __tsplusTrace)(self), __tsplusTrace);
}
/**
 * Provides the effect with its required environment, which eliminates its
 * dependency on `R`.
 *
 * @tsplus static ets/Effect/Aspects provideEnvironment
 */

export const provideEnvironment = (environment, __tsplusTrace) => self => provideEnvironment_(self, environment, __tsplusTrace);
//# sourceMappingURL=provideEnvironment.mjs.map