const fileName_1 = "(@effect/core) _src/io/Layer/operations/memoize.ts";
import * as tsplus_module_1 from "@effect/core/io/Layer/memoMap";
import * as tsplus_module_2 from "@effect/core/io/Effect/operations/scopeWith";
import * as tsplus_module_3 from "@effect/core/io/Effect/operations/memoize";
import * as tsplus_module_4 from "@effect/core/io/Effect/operations/map";
import { ILayerScoped } from "@effect/core/io/Layer/definition";
/**
 * Returns a scoped effect that, if evaluated, will return the lazily computed
 * result of this layer.
 *
 * @tsplus getter ets/Layer memoize
 */

export function memoize(self) {
  return tsplus_module_4.map_(tsplus_module_3.memoize(tsplus_module_2.scopeWith(scope => tsplus_module_1.buildWithScope(self, () => scope, fileName_1 + ":12:57"), fileName_1 + ":12:26"), fileName_1 + ":13:13"), effect => new ILayerScoped(effect), fileName_1 + ":14:9");
}
//# sourceMappingURL=memoize.mjs.map