Function icmp

  • Compare two iterables of Ord to determine their lexicographical ordering.

    Type Parameters

    • T extends Ord<T>

    Parameters

    • lhs: Iterable<T>
    • rhs: Iterable<T>

    Returns Ordering

    Remarks

    Iterables are compared lexicographically, which means:

    • Two iterables are compared element by element.
    • Two empty iterables are lexicographically equal.
    • If two iterables have equivalent elements and are the same size, the iterables are lexicographically equal.
    • An empty iterable is lexicographically less than any non-empty iterable.
    • If one iterable is a prefix of another, the shorter iterable is lexicographically less than the other.
    • The first mismatching element defines which iterable is lexicographically less or greater than the other.

Generated using TypeDoc