fromLessThan<A> static method

Order<A> fromLessThan<A>(
  1. bool f(
    1. A a1,
    2. A a2
    )
)

Define an Order<A> using the given 'less than' function f.

Implementation

static Order<A> fromLessThan<A>(bool Function(A a1, A a2) f) =>
    _Order((x, y) => f(x, y)
        ? -1
        : f(y, x)
            ? 1
            : 0);