import * as tsplus_module_1 from "@effect/core/io/Effect/operations/provideEnvironment";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/flatMap";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/environmentWithEffect";
/**
 * Provides the effect with the single service it requires. If the effect
 * requires more than one service use `provideEnvironment` instead.
 *
 * @tsplus fluent ets/Effect provideServiceEffect
 */

export function provideServiceEffect_(self, tag, effect, __tsplusTrace) {
  return tsplus_module_3.environmentWithEffect(env => tsplus_module_2.flatMap_(effect, service => tsplus_module_1.provideEnvironment_(self, () => env.add(tag, service), __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
/**
 * Provides the effect with the single service it requires. If the effect
 * requires more than one service use `provideEnvironment` instead.
 *
 * @tsplus static ets/Effect/Aspects provideServiceEffect
 */

export const provideServiceEffect = (tag, effect, __tsplusTrace) => self => provideServiceEffect_(self, tag, effect, __tsplusTrace);
//# sourceMappingURL=provideServiceEffect.mjs.map