relaxed constraints HeapFunctions.sort and HeapFunctions.sortWith