3 ms·
It's amusing to mention clarity, given the topic. Because the cargo-cult of this kind of function having return type 'int' is lack of clear thinking manifest. I
by frou_dh 4y ago
It's amusing to mention clarity, given the topic. Because the cargo-cult of this kind of function having return type 'int' is lack of clear thinking manifest. Int has 4-billion distinct values and all they want is three.
Here's clarity:
datatype order https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.order:TY https://smlfamily.github.io/Basis/general.html#SIG:GENERAL.o...
function compare https://smlfamily.github.io/Basis/string.html#SIG:STRING.compare:VAL https://smlfamily.github.io/Basis/string.html#SIG:STRING.com...
case String.compare(a, b) of
| LESS => ...
| EQUAL => ...
| GREATER => ...