import * as tsplus_module_1 from "@effect/core/stream/Stream/operations/provideEnvironment";
import * as tsplus_module_2 from "@effect/core/stream/Stream/operations/environmentWithStream";
import * as tsplus_module_3 from "@effect/core/stream/Stream/operations/succeed";
import * as tsplus_module_4 from "@effect/core/stream/Stream/operations/flatMap";
/**
 * Provides the stream with the single service it requires. If the stream
 * requires multiple services use `provideEnvironment` instead.
 *
 * @tsplus fluent ets/Stream provideService
 */

export function provideService_(self, tag, service, __tsplusTrace) {
  return tsplus_module_4.flatMap_(tsplus_module_3.succeed(service, __tsplusTrace), service => tsplus_module_2.environmentWithStream(env => tsplus_module_1.provideEnvironment_(self, () => env.add(tag, service), __tsplusTrace), __tsplusTrace), __tsplusTrace);
}
/**
 * Provides the stream with the single service it requires. If the stream
 * requires multiple services use `provideEnvironment` instead.
 *
 * @tsplus static ets/Stream/Aspects provideService
 */

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