import type { Environment } from "./env";
import type { CapturedVariableInfo } from "./evaluator/context";
import type { Expr } from "./expr";
import type { FnTraitType, FunctionType, Type } from "./types/definitions";
import type { Value } from "./value";
import { ValueTag } from "./value-tag";
export type FuncValueId = string;
export interface CalledComptimeFunctionCache {
    funcId: FuncValueId;
    argValues: Value[];
    env: Environment;
    value: Value;
    body: Expr;
}
export interface SpecializedFunctionCache {
    funcId: FuncValueId;
    env: Environment;
    compileTimeArgValues: Value[];
    runtimeParameterTypes: Type[];
    specializedFunction: FunctionValue;
}
export type FunctionValue = {
    tag: ValueTag.Function;
    type: FunctionType;
    specializedType?: FunctionType;
    frameLevel: number;
    body: Expr;
    cpsTransformedBody?: Expr;
    funcName?: string;
    funcId: FuncValueId;
    calledComptimeFunctionCaches: CalledComptimeFunctionCache[];
    specializedFunctionCaches: SpecializedFunctionCache[];
    isControlFunction?: boolean;
    definitionSiteEnclosingFunctionType?: FunctionType;
    closureInfo?: ClosureInfo;
    isEffectRecordMember?: boolean;
    isIoAsyncStateMachineClosure?: boolean;
    deriveRule?: FunctionValue;
};
export interface FunctionCapturedVariableInfo extends CapturedVariableInfo {
    value: Value | undefined;
    type: Type;
    isEffectParam?: boolean;
}
export interface ClosureInfo {
    closureType: FnTraitType;
    captureType: Type | undefined;
    effectParamNames?: string[];
    consumedCaptures?: string[];
}
