interface Tuple<F, S> {
    "0": F;
    "1": S;
    length: 2;
    "[iterator]"(): Iterator<F | S>;
    ap<T, S2>(
        f: functional.Tuple<T, (value: S) => S2>,
    ): functional.Tuple<F, S2>;
    bimap<F2, S2>(
        f: (fst: F) => F2,
        g: (snd: S) => S2,
    ): functional.Tuple<F2, S2>;
    equals(other: functional.Tuple<F, S>): boolean;
    every(pred: (value: F | S) => boolean): boolean;
    "fantasy-land/ap"<T, S2>(
        f: functional.Tuple<T, (value: S) => S2>,
    ): functional.Tuple<F, S2>;
    "fantasy-land/bimap"<F2, S2>(
        f: (fst: F) => F2,
        g: (snd: S) => S2,
    ): functional.Tuple<F2, S2>;
    "fantasy-land/equals"(other: functional.Tuple<F, S>): boolean;
    "fantasy-land/map"<S2>(f: (snd: S) => S2): functional.Tuple<F, S2>;
    "fantasy-land/reduce"<T>(
        reducer: (accumulator: T, value: S) => T,
        initialValue: T,
    ): T;
    fst(): F;
    inspect(): string;
    map<S2>(f: (snd: S) => S2): functional.Tuple<F, S2>;
    mapFirst<F2>(f: (fst: F) => F2): functional.Tuple<F2, S>;
    reduce<T>(reducer: (accumulator: T, value: S) => T, initialValue: T): T;
    snd(): S;
    some(pred: (value: F | S) => boolean): boolean;
    swap(): functional.Tuple<S, F>;
    toArray(): [F, S];
    toJSON(): [F, S];
    toString(): string;
    [index: number]: F | S;
}

Type Parameters

  • F
  • S

Hierarchy

  • Iterable<F | S>
  • ArrayLike<F | S>
    • Tuple

Indexable

  • [index: number]: F | S

Properties

"0": F
"1": S
length: 2

Methods

  • Returns Iterator<F | S>

  • Transforms the two values inside this with two mapper functions

    Type Parameters

    • F2
    • S2

    Parameters

    • f: (fst: F) => F2
    • g: (snd: S) => S2

    Returns functional.Tuple<F2, S2>

  • Compares the values inside this and another tuple

    Parameters

    Returns boolean

  • Tests whether both elements in the tuple pass the test implemented by the provided function

    Parameters

    • pred: (value: F | S) => boolean

    Returns boolean

  • Type Parameters

    • T

    Parameters

    • reducer: (accumulator: T, value: S) => T
    • initialValue: T

    Returns T

  • Returns the first value of this

    Returns F

  • Returns string

  • Applies a function to the second value of this

    Type Parameters

    • S2

    Parameters

    • f: (snd: S) => S2

    Returns functional.Tuple<F, S2>

  • Applies a function to the first value of this

    Type Parameters

    • F2

    Parameters

    • f: (fst: F) => F2

    Returns functional.Tuple<F2, S>

  • A somewhat arbitrary implementation of Foldable for Tuple, the reducer will be passed the initial value and the second value inside this as arguments

    Type Parameters

    • T

    Parameters

    • reducer: (accumulator: T, value: S) => T
    • initialValue: T

    Returns T

  • Returns the second value of this

    Returns S

  • Tests whether at least one element in the tuple passes the test implemented by the provided function

    Parameters

    • pred: (value: F | S) => boolean

    Returns boolean

  • Returns an array with 2 elements - the values inside this

    Returns [F, S]

  • Returns [F, S]

  • Returns a string representation of an object.

    Returns string