Prelude API
    Preparing search index...

    Function pair

    • Creates a generator that yields pairs of values from two iterables. Stops when either iterable is exhausted.

      Type Parameters

      • A

        Type of values in the left iterable

      • B

        Type of values in the right iterable

      Parameters

      • rhsIterable: Iterable<B>

        The right-hand side iterable

      Returns (lhsIterable: Iterable<A>) => Generator<[A, B]>

      A function that takes a left-hand side iterable and yields pairs

      Pairs of values from both iterables as [A, B] arrays

      G.pipe(
      [1, 2, 3],
      G.pair(['a', 'b', 'c']),
      G.array
      ) // [[1, 'a'], [2, 'b'], [3, 'c']]

      // With different length iterables, stops at the shorter one
      G.pipe(
      [1, 2, 3, 4, 5],
      G.pair(['a', 'b', 'c']),
      G.array
      ) // [[1, 'a'], [2, 'b'], [3, 'c']]