FuncType - v0.9.5
    Preparing search index...

    Interface Tuple<T>

    Foldable type class represents data structures that can be folded to a summary value.

    interface Tuple<T extends Type[]> {
        _tag: "Tuple";
        length: number;
        "[iterator]"(): Iterator<T[number]>;
        flatMap<U extends unknown[]>(f: (value: T) => Tuple<U>): Tuple<U>;
        fold<B>(onEmpty: () => B, onValue: (value: T[number]) => B): B;
        foldLeft<B>(z: B): (op: (b: B, a: T[number]) => B) => B;
        foldRight<B>(z: B): (op: (a: T[number], b: B) => B) => B;
        get<K extends number>(index: K): T[K];
        map<U extends unknown[]>(f: (value: T) => U): Tuple<U>;
        pipe<U extends unknown>(f: (value: Tuple) => U): U;
        serialize(): SerializationMethods<Tuple<T>>;
        toArray(): T;
        toString(): string;
        toValue(): { _tag: "Tuple"; value: T };
    }

    Type Parameters

    • T extends Type[]

      The type of elements in the data structure

    Hierarchy (View Summary)

    Index

    Properties

    _tag: "Tuple"
    length: number

    Methods

    • Returns Iterator<T[number]>

    • Type Parameters

      • U extends unknown[]

      Parameters

      Returns Tuple<U>

    • Pattern matches over the structure, applying specific handlers for each variant

      Type Parameters

      • B

      Parameters

      • onEmpty: () => B

        Function to apply if the structure is empty or has no value

      • onValue: (value: T[number]) => B

        Function to apply if the structure has a value

      Returns B

      The result of applying the appropriate function

    • Left-associative fold using the provided zero value and operation

      Type Parameters

      • B

      Parameters

      • z: B

        Zero/identity value

      Returns (op: (b: B, a: T[number]) => B) => B

      A function that takes an operation to apply

    • Right-associative fold using the provided zero value and operation

      Type Parameters

      • B

      Parameters

      • z: B

        Zero/identity value

      Returns (op: (a: T[number], b: B) => B) => B

      A function that takes an operation to apply

    • Type Parameters

      • K extends number

      Parameters

      • index: K

      Returns T[K]

    • Type Parameters

      • U extends unknown[]

      Parameters

      • f: (value: T) => U

      Returns Tuple<U>

    • Pipes the value through the provided function

      Type Parameters

      • U extends unknown

        The return type of the function

      Parameters

      • f: (value: Tuple) => U

        The function to apply to the value

      Returns U

      The result of applying the function to the value

    • Returns T

    • Returns a string representation of an object.

      Returns string

    • Returns { _tag: "Tuple"; value: T }