/** * @since 4.0.0 */ import type * as Effect from "./Effect.ts" import type * as Fiber from "./Fiber.ts" import { evaluate, makePrimitiveProto } from "./internal/core.ts" /** * Create a low-level `Effect` prototype. * * When the effect is evaluated, it will call `evaluate` with the current fiber. * * @since 4.0.0 * @category Prototypes */ export const Prototype = >(options: { readonly label: string readonly evaluate: ( this: A, fiber: Fiber.Fiber ) => Effect.Effect, Effect.Error, Effect.Services> }): Effect.Effect, Effect.Error, Effect.Services> => makePrimitiveProto({ op: options.label, [evaluate]: options.evaluate }) as any const Base: new() => Effect.Effect = (() => { const Base = function() {} Base.prototype = Prototype({ label: "Effectable", evaluate(_) { return this } }) return Base as any })() /** * An abstract class that can be extended to create an `Effect`. * * @since 4.0.0 * @category Constructors */ export abstract class Class extends Base { abstract override: Effect.Effect }