in reply to Re: A proper name for is_sorted function that can check more than just sorting order?
in thread A proper name for is_sorted function that can check more than just sorting order?

After having a closer look into all aspects discussed in the WP page, I'm afraid that my intuition wasn't too bad and "Monotonicity" is indeed not a good idea.

Basically because it defines for all elements x ≤ y => f(x) ≤ f(y)

Since the OP is only testing adjacent elements, this can only be true with a transitive relation inside the testing block.

But this can't be guaranteed because the user is free to apply any code there.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery

  • Comment on Re^2: A proper name for is_sorted function that can check more than just sorting order?