import "Prelude" importJava "java.util.Comparator" where """ A comparison function, which imposes a total ordering on some collection of objects """ data Comparator a @JavaName compare """ Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second. """ compareWithComparator :: Comparator a -> a -> a -> Integer """ Sorts the list using the given comparator. """ sortWithComparator :: Comparator a -> [a] -> [a] sortWithComparator = sortWith . compareWithComparator