Prelude API
    Preparing search index...

    Function sort

    • Returns a generator that yields elements from the input iterable in sorted order.

      Type Parameters

      • T

        The type of elements in the iterable

      Parameters

      • cmp: Cmp.t<T>

        The comparison function to determine sort order

      Returns (values: Iterable<T>) => Generator<T, void, unknown>

      Elements from the input iterable in sorted order

      G.pipe(
      [3, 1, 4, 1, 5],
      G.sort((a, b) => a - b),
      G.array
      ) // [1, 1, 3, 4, 5]