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 effect/core/io/Layer memoize */ export function memoize( self: Layer ): Effect> { return Effect.scopeWith((scope) => self.buildWithScope(scope)) .memoize .map((effect) => new ILayerScoped(effect)) }