Joins the given two compare functions and returns the combined compare function.
a compare function
the new compare function