keyOf<T, R extends Comparable<R>> function

Comparator<T> keyOf<T, R extends Comparable<R>>(
  1. R transformation(
    1. T value
    )
)

Creates a comparator that compares values of type T but delegates the decision to a Comparable<R> with the provided transformation.

Implementation

Comparator<T> keyOf<T, R extends Comparable<R>>(
  R Function(T value) transformation,
) => naturalComparable<R>.keyOf(transformation);