@pond-ts/process API Reference
    Preparing search index...

    Interface FoldDef

    A fold — a node that ends in a fact rather than a column.

    Reductions used to be a fixed enum on the selector, computed after the graph had finished: last rescanned 150,000 values on a total cache hit, and percentileRank densified and filtered twice, every request, forever. Measured at 10.85 ms of an 11.6 ms warm run — the graph memoized every intermediate and then recomputed the only part anyone actually read.

    A fold is an ordinary registry entry with an ordinary content-addressed id, so it caches, it carries provenance, and a consumer adds one by calling define rather than by editing this library. What it cannot do is feed anything: a fold produces a fact, so it is always a leaf, and naming one as an op's input is rejected at compile time.

    interface FoldDef {
        family: string;
        fold: (ctx: FoldContext) => FactBody;
        inputs: readonly InputDef[];
        kind: "fold";
        label?: (params: Params, inputs: string) => string;
        name: string;
        params: Readonly<Record<string, ParamDef>>;
        summary: string;
        unit: string;
    }
    Index

    Properties

    family: string
    fold: (ctx: FoldContext) => FactBody
    inputs: readonly InputDef[]
    kind: "fold"
    label?: (params: Params, inputs: string) => string
    name: string
    params: Readonly<Record<string, ParamDef>>
    summary: string
    unit: string

    The unit the fact carries. 'inherit' takes input 0's.