devtypes - v1.1.0
    Preparing search index...

    Type Alias Curry<F>

    Curry: F extends (...args: infer Args) => infer R
        ? Args extends [infer A, ...(infer Rest)]
            ? (a: A) => Curry<(...args: Rest) => R>
            : R
        : never

    Curry a function type.

    Type Parameters

    • F

      Function type to curry

    Transforms a multi-argument function into a sequence of unary functions. Used for functional programming patterns.

    type Fn = ( a: string, b: number, c: boolean ) => void;
    type CurriedFn = Curry< Fn >;
    // ( a: string ) => ( b: number ) => ( c: boolean ) => void