import * as tsplus_module_1 from "@effect/core/stm/STM/operations/provideSomeEnvironment";
import * as tsplus_module_2 from "@effect/core/stm/STM/operations/succeed";
import * as tsplus_module_3 from "@effect/core/stm/STM/operations/flatMap";
/**
 * Provides the effect with the single service it requires. If the effect
 * requires more than one service use `provideEnvironment` instead.
 *
 * @tsplus fluent ets/STM provideService
 */

export function provideService_(self, tag, service) {
  return tsplus_module_3.flatMap_(tsplus_module_2.succeed(service), service => tsplus_module_1.provideSomeEnvironment_(self, env => env.add(tag, service)));
}
/**
 * Provides the effect with the single service it requires. If the effect
 * requires more than one service use `provideEnvironment` instead.
 *
 * @tsplus static ets/STM/Aspects provideService
 */

export const provideService = (tag, service) => self => provideService_(self, tag, service);
//# sourceMappingURL=provideService.mjs.map