import * as tsplus_module_1 from "@effect/core/stream/Channel/operations/provideEnvironment";
import * as tsplus_module_2 from "@effect/core/io/Layer/memoMap";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/map";
import * as tsplus_module_4 from "@effect/core/stream/Channel/operations/unwrapScoped";
/**
 * Provides a layer to the channel, which translates it to another level.
 *
 * @tsplus fluent ets/Channel provideLayer
 */

export function provideLayer_(self, layer, __tsplusTrace) {
  return tsplus_module_4.unwrapScoped(tsplus_module_3.map_(tsplus_module_2.build(layer(), __tsplusTrace), env => tsplus_module_1.provideEnvironment_(self, () => env), __tsplusTrace));
}
/**
 * Provides a layer to the channel, which translates it to another level.
 *
 * @tsplus static ets/Channel/Aspects provideLayer
 */

export const provideLayer = (layer, __tsplusTrace) => self => provideLayer_(self, layer, __tsplusTrace);
//# sourceMappingURL=provideLayer.mjs.map