export abstract class Lazy { constructor(protected readonly thunk: () => Lazy) { } private $memory?: this = undefined; protected evaluate(): this { return this.$memory ??= this.thunk() as this; } public abstract extract(): unknown; }